Open mattwelborn opened 5 years ago
Hi @mattwelborn, good catch. The parsing of the -w flag was not implemented when a string command is provided as an argument. This because in this case the command is sent directly to AWS Batch instead of composing a wrapper script (which is in charge to switch the working directory). I'm marking this as bug, in order to have the user experience consistent. Just for curiosity what's the use case of using a simple command provided as argument?
I was using it in a bash loop in order to run a computationally intensive code on each of a few thousand input files.
Environment:
Bug description and how to reproduce: The
-w
flag is ignored byawsbsub
when a string command is provided as an argument. Looking at cli/awsbatch/awsbsub.py, it can be seen thatargs.working_dir
is only used in_compose_bash_command
which is only calledif args.command_file or not sys.stdin.isatty() or args.env
.Incorrect behavior example: Input:
awsbsub -w /home/ec2-user pwd
Output:Correct behavior example: Input:
echo pwd | awsbsub -w /home/ec2-user
Output: