mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Add --version
flag
This commit is contained in:
parent
3ab5c07559
commit
d76ffa8fd8
3 changed files with 30 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue