mirror of
https://github.com/servo/servo.git
synced 2025-06-30 12:03:38 +01:00
Add ./mach rustup
This commit is contained in:
parent
a26079d322
commit
84558ff23f
1 changed files with 18 additions and 0 deletions
|
@ -11,6 +11,8 @@ from __future__ import print_function, unicode_literals
|
|||
from os import path, getcwd, listdir
|
||||
|
||||
import sys
|
||||
import urllib2
|
||||
import json
|
||||
|
||||
from mach.decorators import (
|
||||
CommandArgument,
|
||||
|
@ -223,6 +225,22 @@ class MachCommands(CommandBase):
|
|||
["git"] + ["grep"] + params + ['--'] + grep_paths + [':(exclude)*.min.js', ':(exclude)*.min.css'],
|
||||
env=self.build_env())
|
||||
|
||||
@Command('rustup',
|
||||
description='Update the Rust version to latest master',
|
||||
category='devenv')
|
||||
def rustup(self):
|
||||
url = "https://api.github.com/repos/rust-lang/rust/git/refs/heads/master"
|
||||
commit = json.load(urllib2.urlopen(url))["object"]["sha"]
|
||||
filename = path.join(self.context.topdir, "rust-commit-hash")
|
||||
with open(filename, "w") as f:
|
||||
f.write(commit)
|
||||
|
||||
# Reset self.config["tools"]["rust-root"]
|
||||
self._rust_version = None
|
||||
self.set_use_stable_rust(False)
|
||||
|
||||
self.fetch()
|
||||
|
||||
@Command('fetch',
|
||||
description='Fetch Rust, Cargo and Cargo dependencies',
|
||||
category='devenv')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue