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
ENOENT because 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.
Summary
docker/run-sync.shbreaks whenSYNC_ARGScontains quoted arguments with spaces because it usesEXTRA_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-syncENOENTbecause it tries to run/tmp/my.Expected Result
SYNC_ARGSshould 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.shat theEXTRA_ARGS=($SYNC_ARGS)line. Usingread -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 likebash -lcto expand properly, or (best) avoidevaland let users mount a config file.