[Docker] Cannot pass quoted strings as CLI arguments through docker.sh
Closed this issue · 2 comments
Montspy commented
It looks like somewhere along the chain shell -> docker.sh -> transfer bash script -> python transfer.py
, quoted strings lose their quotes.
I am trying to add a --memo
argument to the transfer.py
script.
python3 generator/transfer.py --memo "This is a memo~!" --other arg # works fine Python gets this as ['--memo', 'This is a memo~!', '--other', 'arg']
./docker.sh transfer --memo "This is a memo~!" --other arg # Python gets this as ['--memo', 'This', 'is', 'a', 'memo~!', '--other', 'arg']
Montspy commented
A quick google search points toward changing $@
to "$@"
in docker.sh
and all shell scripts in dockerfiles/scripts
Example:
#!/bin/sh
cd /var/www/html
python3 generator/transfer.py $@
to
#!/bin/sh
cd /var/www/html
python3 generator/transfer.py "$@"
Montspy commented
Implemented, will close when it reaches main branch.