Add directory to PATH (with_path)
If you want to run a command with an additional folder on the path you can specify it with with_path.
Note that if you use CommandPath object, the directory you use it on is already added.
bin_directory/ls:
#!/bin/bash
echo hello $1 > output
#!/bin/bash
ls $1
from commandlib import Command
runls = Command("./runls")
Add bin_directory to PATH for runls:
runls("harry").with_path("bin_directory").run()
File 'output' will contain:
hello harry
Executable specification
Documentation automatically generated from with-path.story storytests.