Closed amine-smile closed 1 year ago
Looks good, could you please add a test to the test-suite?
Why do we need to the --cmd-switch? Wouldn't it be more unix-like having just the command afterwards:
cooker shell <build> bitbake -c cve_check <package-name>
Like for example with ssh?
I think that it would be interesting to be able to pass a list of commands, each command with its parameters in a single string. So it would be possible to execute the sequence of commands successively in the same shell (useful for example to cd
before running a command)
I think that it would be interesting to be able to pass a list of commands, each command with its parameters in a single string. So it would be possible to execute the sequence of commands successively in the same shell (useful for example to
cd
before running a command)
This can be achieved by creating a script-file and run
cooker shell <build> $(realpath batch.sh)
if batch.sh
is executable.
I'd prefer this rather than bloating cooker.
I think that it would be interesting to be able to pass a list of commands, each command with its parameters in a single string. So it would be possible to execute the sequence of commands successively in the same shell (useful for example to
cd
before running a command)This can be achieved by creating a script-file and run
cooker shell <build> $(realpath batch.sh)
if
batch.sh
is executable.I'd prefer this rather than bloating cooker.
That or supporting shell based sequence (like ssh) : cooker shell <build> "cmd1; cmd2; cmd3 && cmd4"
?
I think that it would be interesting to be able to pass a list of commands, each command with its parameters in a single string. So it would be possible to execute the sequence of commands successively in the same shell (useful for example to
cd
before running a command)This can be achieved by creating a script-file and run
cooker shell <build> $(realpath batch.sh)
ifbatch.sh
is executable. I'd prefer this rather than bloating cooker.That or supporting shell based sequence (like ssh) :
cooker shell <build> "cmd1; cmd2; cmd3 && cmd4"
?
Both would work without any change to cooker ;-), except (the adapted version of) this patch.
@amine-smile has (sadly) no time to work on this anymore... I'll take over and send a new PR with :
nargs='*'
(patch is ready)@amine-smile has (sadly) no time to work on this anymore... I'll take over and send a new PR with :
* `nargs='*'` (patch is ready) * a test in the test-suite
=> #146
Updated the shell command to support executing a command within the poky-initialized shell. Introduced the -c/--cmd option, which allows users to specify a command to be executed. When the -c option is provided, the specified command is executed within the shell environment.
Example:
cooker shell <cooker-build> --cmd 'bitbake -c cve_check <package-name>'