Skip to content

Confusion with relative path and _cwd #372

@terhorst

Description

@terhorst

Not sure if this is a bug, but I ran into this issue when trying to a call a script which needs the working directory to be the same as the directory in which it lives:

>>> script = sim.Command("relative/path/script.sh").bake(_cwd="relative/path")
>>> script()
sh.ErrorReturnCode_255:
[snip]

The shell seems to be unable to actually find the script, and returns 255. Passing in the absolute path, i.e.

>>> sim.Command(os.path.abspath("relative/path/script.sh")).bake(_cwd="relative/path")

has the expected behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions