Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(644)

Unified Diff: go/bootstrap.py

Issue 2121653002: Fix prompt exporting escaped characters, opt into PS1 mod. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Only use $'...' notation if there was actually an escaped character. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | go/env.py » ('j') | go/env.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/bootstrap.py
diff --git a/go/bootstrap.py b/go/bootstrap.py
index 196f3dbd44cb981beb4996e1435a14f92ba425bf..b09b3eb7e998f5161ef7fbbfcfb342e66fda86b5 100755
--- a/go/bootstrap.py
+++ b/go/bootstrap.py
@@ -394,11 +394,11 @@ def get_go_environ(
env.pop('APPENGINE_DEV_APPSERVER', None)
# Add a tag to the prompt
- prompt = env.get('PS1')
- if prompt:
- prompttag = env.get('INFRA_PROMPT_TAG', '[cr go] ')
- if prompttag not in prompt:
- env['PS1'] = prompttag + prompt
+ infra_prompt_tag = env.get('INFRA_PROMPT_TAG')
+ if infra_prompt_tag:
+ prompt = env.get('PS1')
+ if prompt and infra_prompt_tag not in prompt:
+ env['PS1'] = infra_prompt_tag + prompt
return env
« no previous file with comments | « no previous file | go/env.py » ('j') | go/env.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698