-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
docker/run-sync.sh breaks when SYNC_ARGS contains quoted arguments with spaces because it uses EXTRA_ARGS=($SYNC_ARGS). Bash splits on whitespace and removes the quotes, so a value like --script "/tmp/my script.sh" turns into two separate arguments.
Steps to Reproduce
docker run ... -e SYNC_ARGS='--script "/tmp/my script.sh"' learning-genie-sync- The container starts, but the sync script fails with
ENOENTbecause it tries to run/tmp/my.
Expected Result
SYNC_ARGS should be parsed so that quoted segments stay intact.
Actual Result
Arguments with spaces or shell quoting are mangled before being passed to node lg.mjs.
Additional Context
The word-splitting happens in docker/run-sync.sh at the EXTRA_ARGS=($SYNC_ARGS) line. Using read -r -a EXTRA_ARGS <<< "$SYNC_ARGS" is still subject to word splitting; a more robust fix would be to allow users to provide an arguments file, or parse with something like bash -lc to expand properly, or (best) avoid eval and let users mount a config file.