Skip to content

cli: expand tilde in --script paths like other local path inputs #43

Description

@ultimatile

The CLI expands an unexpanded tilde (a quoted flag value, or a value injected from a script) in every user-supplied local path input — --config, $CREWSTER_CONFIG / $HPC_CONFIG, --project-dir, and sync.pull_dir — through the shared _expand_user_path helper in src/crewster/cli.py. The --script option of crewster exec and crewster submit is the one remaining local path input outside that rule: it is checked raw, so --script '~/jobs/run.sh' fails with Script not found: ~/jobs/run.sh even though the same tilde in --config or --project-dir on the same command line expands fine.

Proposal

Route --script through _expand_user_path before the existence check in both commands. Alternatively fold it into a shared script-loading helper: the block that accepts either a positional command or --script and reads the script file is duplicated between exec_cmd and submit in src/crewster/cli.py. Add a test mirroring test_project_dir_expands_tilde / test_config_expands_tilde in tests/test_cli.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions