diff options
author | Cameron Paul <cpaul37@gmail.com> | 2016-05-19 00:01:32 -0500 |
---|---|---|
committer | Cameron Paul <cpaul37@gmail.com> | 2016-06-28 20:00:39 -0500 |
commit | d76ffa8fd8b9311ef13eb477c55fc0b7dce753f5 (patch) | |
tree | 2b65b24973d684c8c0359dd9fc104f65531889c0 /python/servo/command_base.py | |
parent | 3ab5c075595f6bffe3062e26d91f4837fedbf19c (diff) | |
download | servo-d76ffa8fd8b9311ef13eb477c55fc0b7dce753f5.tar.gz servo-d76ffa8fd8b9311ef13eb477c55fc0b7dce753f5.zip |
Add `--version` flag
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r-- | python/servo/command_base.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 79e1fb8f3c1..96d179d4c0f 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -413,6 +413,22 @@ class CommandBase(object): env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -W unused-extern-crates" + git_info = [] + if os.path.isdir('.git'): + git_sha = subprocess.check_output([ + 'git', 'rev-parse', '--short', 'HEAD' + ]).strip() + git_is_dirty = bool(subprocess.check_output([ + 'git', 'status', '--porcelain' + ]).strip()) + + git_info.append('') + git_info.append(git_sha) + if git_is_dirty: + git_info.append('dirty') + + env['GIT_INFO'] = '-'.join(git_info) + return env def servo_crate(self): |