mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 05:01:23 +00:00
gst-env.py: drop 'gst-' prefix from branch name in prompt
Probably leftover from the days where we would have a gst-foo.sh script to set up the devenv for a particular checkout/branch. Kind of confusing now if you're working on a named branch and it just adds an extra gst- prefix in the prompt. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2594>
This commit is contained in:
parent
cdf5ee470b
commit
936143599c
1 changed files with 6 additions and 6 deletions
12
gst-env.py
12
gst-env.py
|
@ -265,7 +265,7 @@ def get_subprocess_env(options, gst_version):
|
||||||
prepend_env_var(env, "GST_VALIDATE_APPS_DIR", os.path.normpath(
|
prepend_env_var(env, "GST_VALIDATE_APPS_DIR", os.path.normpath(
|
||||||
"%s/subprojects/gst-editing-services/tests/validate" % SCRIPTDIR),
|
"%s/subprojects/gst-editing-services/tests/validate" % SCRIPTDIR),
|
||||||
options.sysroot)
|
options.sysroot)
|
||||||
env["GST_ENV"] = 'gst-' + gst_version
|
env["GST_ENV"] = gst_version
|
||||||
env["GST_REGISTRY"] = os.path.normpath(options.builddir + "/registry.dat")
|
env["GST_REGISTRY"] = os.path.normpath(options.builddir + "/registry.dat")
|
||||||
prepend_env_var(env, "PATH", os.path.normpath(
|
prepend_env_var(env, "PATH", os.path.normpath(
|
||||||
"%s/subprojects/gst-devtools/validate/tools" % options.builddir),
|
"%s/subprojects/gst-devtools/validate/tools" % options.builddir),
|
||||||
|
@ -552,7 +552,7 @@ if __name__ == "__main__":
|
||||||
if shell in ['powershell.exe', 'pwsh.exe']:
|
if shell in ['powershell.exe', 'pwsh.exe']:
|
||||||
new_args = [shell, '-NoLogo']
|
new_args = [shell, '-NoLogo']
|
||||||
if not args:
|
if not args:
|
||||||
prompt = 'function global:prompt { "[gst-' + gst_version + '"+"] PS " + $PWD + "> "}'
|
prompt = 'function global:prompt { "[' + gst_version + '"+"] PS " + $PWD + "> "}'
|
||||||
new_args += ['-NoExit', '-Command', prompt]
|
new_args += ['-NoExit', '-Command', prompt]
|
||||||
else:
|
else:
|
||||||
new_args += ['-NonInteractive', '-Command'] + args
|
new_args += ['-NonInteractive', '-Command'] + args
|
||||||
|
@ -560,7 +560,7 @@ if __name__ == "__main__":
|
||||||
else:
|
else:
|
||||||
new_args = [os.environ.get("COMSPEC", r"C:\WINDOWS\system32\cmd.exe")]
|
new_args = [os.environ.get("COMSPEC", r"C:\WINDOWS\system32\cmd.exe")]
|
||||||
if not args:
|
if not args:
|
||||||
new_args += ['/k', 'prompt [gst-{}] $P$G'.format(gst_version)]
|
new_args += ['/k', 'prompt [{}] $P$G'.format(gst_version)]
|
||||||
else:
|
else:
|
||||||
new_args += ['/c', 'start', '/b', '/wait'] + args
|
new_args += ['/c', 'start', '/b', '/wait'] + args
|
||||||
args = new_args
|
args = new_args
|
||||||
|
@ -574,7 +574,7 @@ if __name__ == "__main__":
|
||||||
if os.path.exists(bashrc):
|
if os.path.exists(bashrc):
|
||||||
with open(bashrc, 'r') as src:
|
with open(bashrc, 'r') as src:
|
||||||
shutil.copyfileobj(src, tmprc)
|
shutil.copyfileobj(src, tmprc)
|
||||||
tmprc.write('\nexport PS1="[gst-%s] $PS1"' % gst_version)
|
tmprc.write('\nexport PS1="[%s] $PS1"' % gst_version)
|
||||||
tmprc.flush()
|
tmprc.flush()
|
||||||
if is_bash_completion_available(options):
|
if is_bash_completion_available(options):
|
||||||
bash_completions_files = []
|
bash_completions_files = []
|
||||||
|
@ -595,7 +595,7 @@ if __name__ == "__main__":
|
||||||
args.append('--init-command')
|
args.append('--init-command')
|
||||||
prompt_cmd = '''functions --copy fish_prompt original_fish_prompt
|
prompt_cmd = '''functions --copy fish_prompt original_fish_prompt
|
||||||
function fish_prompt
|
function fish_prompt
|
||||||
echo -n '[gst-{}] '(original_fish_prompt)
|
echo -n '[{}] '(original_fish_prompt)
|
||||||
end'''.format(gst_version)
|
end'''.format(gst_version)
|
||||||
args.append(prompt_cmd)
|
args.append(prompt_cmd)
|
||||||
elif args[0].endswith('zsh'):
|
elif args[0].endswith('zsh'):
|
||||||
|
@ -606,7 +606,7 @@ if __name__ == "__main__":
|
||||||
if os.path.exists(zshrc):
|
if os.path.exists(zshrc):
|
||||||
with open(zshrc, 'r') as src:
|
with open(zshrc, 'r') as src:
|
||||||
shutil.copyfileobj(src, tmprc)
|
shutil.copyfileobj(src, tmprc)
|
||||||
tmprc.write('\nexport PROMPT="[gst-{}] $PROMPT"'.format(gst_version))
|
tmprc.write('\nexport PROMPT="[{}] $PROMPT"'.format(gst_version))
|
||||||
tmprc.flush()
|
tmprc.flush()
|
||||||
env['ZDOTDIR'] = tmpdir.name
|
env['ZDOTDIR'] = tmpdir.name
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue