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

Side by Side 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: Re-enable by default, document the tag, comments. 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 unified diff | Download patch
« go/README.md ('K') | « go/README.md ('k') | go/env.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Prepares a local hermetic Go installation. 6 """Prepares a local hermetic Go installation.
7 7
8 - Downloads and unpacks the Go toolset in ../../golang. 8 - Downloads and unpacks the Go toolset in ../../golang.
9 - Downloads and installs Glide (used by deps.py). 9 - Downloads and installs Glide (used by deps.py).
10 - Fetches code dependencies via deps.py. 10 - Fetches code dependencies via deps.py.
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 # APPENGINE_DEV_APPSERVER is used by "appengine/aetest" package. If it's 387 # APPENGINE_DEV_APPSERVER is used by "appengine/aetest" package. If it's
388 # missing, aetest will scan PATH looking for dev_appserver.py, possibly 388 # missing, aetest will scan PATH looking for dev_appserver.py, possibly
389 # finding it in some other place. 389 # finding it in some other place.
390 if go_appengine_path: 390 if go_appengine_path:
391 env['APPENGINE_DEV_APPSERVER'] = os.path.join( 391 env['APPENGINE_DEV_APPSERVER'] = os.path.join(
392 go_appengine_path, 'dev_appserver.py') 392 go_appengine_path, 'dev_appserver.py')
393 else: 393 else:
394 env.pop('APPENGINE_DEV_APPSERVER', None) 394 env.pop('APPENGINE_DEV_APPSERVER', None)
395 395
396 # Add a tag to the prompt 396 # Add a tag to the prompt
397 prompt = env.get('PS1') 397 infra_prompt_tag = env.get('INFRA_PROMPT_TAG')
398 if prompt: 398 if infra_prompt_tag is None:
399 prompttag = env.get('INFRA_PROMPT_TAG', '[cr go] ') 399 infra_prompt_tag = '[cr go] '
400 if prompttag not in prompt: 400 if infra_prompt_tag:
401 env['PS1'] = prompttag + prompt 401 prompt = env.get('PS1')
402 if prompt and infra_prompt_tag not in prompt:
403 env['PS1'] = infra_prompt_tag + prompt
402 404
403 return env 405 return env
404 406
405 407
406 def get_go_exe(toolset_root): 408 def get_go_exe(toolset_root):
407 """Returns path to go executable.""" 409 """Returns path to go executable."""
408 return os.path.join(toolset_root, 'go', 'bin', 'go' + EXE_SFX) 410 return os.path.join(toolset_root, 'go', 'bin', 'go' + EXE_SFX)
409 411
410 412
411 def bootstrap(go_paths, logging_level): 413 def bootstrap(go_paths, logging_level):
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 return name 480 return name
479 481
480 482
481 def main(): 483 def main():
482 bootstrap([WORKSPACE], logging.DEBUG) 484 bootstrap([WORKSPACE], logging.DEBUG)
483 return 0 485 return 0
484 486
485 487
486 if __name__ == '__main__': 488 if __name__ == '__main__':
487 sys.exit(main()) 489 sys.exit(main())
OLDNEW
« go/README.md ('K') | « go/README.md ('k') | go/env.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698