Skip to content

Handle SYNC_ARGS values containing spaces #3

@MChartier

Description

@MChartier

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

  1. docker run ... -e SYNC_ARGS='--script "/tmp/my script.sh"' learning-genie-sync
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions