sultan icon indicating copy to clipboard operation
sultan copied to clipboard

Problems when sourcing a file

Open guilhermeleobas opened this issue 6 years ago • 0 comments

Hi,

When sourcing a file, the sourcing process happens in the dir that the script is running and not in the one specified by cwd. For instance, if one is in /foo and the script below is in /foo/bar/baz, the variable var is equal to foo and not baz. It's possible to add a flag indicating where the sourcing happens?

export var=$(basename $(pwd))

Also, the path src script must always be absolute or can be relative to cwd?

with Sultan.load(
        cwd='/foo/bar',
        src='baz/config.sh') as s:
    s.pip(...)

Regards

guilhermeleobas avatar Aug 02 '18 04:08 guilhermeleobas