Montspy / LooPyGen

Loopring Python Minter on Layer 2
17 stars 6 forks source link

[Docker] Cannot pass quoted strings as CLI arguments through docker.sh #62

Closed Montspy closed 2 years ago

Montspy commented 2 years ago

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 2 years ago

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 2 years ago

Implemented, will close when it reaches main branch.