rezplugins.shell.gitbash

Git Bash (for Windows) shell

class rezplugins.shell.gitbash.GitBash[source]

Bases: rezplugins.shell.bash.Bash

Git Bash shell plugin.

classmethod executable_name()[source]

Name of executable to create shell instance.

classmethod find_executable(name, check_syspaths=False)[source]

Find an executable.

Parameters
  • name (str) – Program name.

  • check_syspaths (bool) – If True, check the standard system paths as well, if program was not found on current $PATH.

Returns

Full filepath of executable.

Return type

str

classmethod get_syspaths()[source]
classmethod name()[source]

Plugin name.

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

str

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 = ':'
rezplugins.shell.gitbash.register_plugin()[source]