rezplugins.shell.gitbash
Git Bash (for Windows) shell
- class rezplugins.shell.gitbash.GitBash[source]
Bases:
rezplugins.shell.bash.BashGit Bash shell plugin.
- normalize_path(path)[source]
Normalize a path.
Change path to a valid filepath representation for this interpreter.
IMPORTANT: Because var references like ${THIS} might be passed to funcs like appendvar, path might be in this form. You need to take that into account (ie, ensure normalization doesn’t break such a var reference).
- Parameters
path (str) – A filepath which may be in posix format, or windows format, or some combination of the two. For eg, a string like {root}/bin on windows will evaluate to C:.../bin - in this case, the cmd shell would want to normalize this and convert to all forward slashes.
- Returns
The normalized path.
- Return type
- normalize_paths(value)[source]
This is a bit tricky in the case of gitbash. The problem we hit is that our pathsep is ‘:’, _but_ pre-normalised paths also contain ‘:’ (eg C:
oo). In other words we have to deal with values like ‘C: oo:C:ah’.
To get around this, we do the drive-colon replace here instead of in normalize_path(), so we can then split the paths correctly. Note that normalize_path() still does drive-colon replace also - it needs to behave correctly if passed a string like C:
oo.
- pathsep = ':'