зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1262978: Run npm to get the path to installed binaries if eslint can't otherwise be found. r=gps
MozReview-Commit-ID: HFWID6QhpS2 --HG-- extra : rebase_source : bed90ecf7b59b348ec5047c9ac9e8cc31a2aa193 extra : amend_source : 97f81e0bb34098c1aaad1b2ad4355d3f0ad6f72c
This commit is contained in:
Родитель
c515d4ce79
Коммит
f2c61524b0
|
@ -166,7 +166,18 @@ class MachCommands(MachCommandBase):
|
|||
try:
|
||||
binary = which.which('eslint')
|
||||
except which.WhichError:
|
||||
pass
|
||||
npmPath = self.getNodeOrNpmPath("npm")
|
||||
if npmPath:
|
||||
try:
|
||||
output = subprocess.check_output([npmPath, "bin", "-g"],
|
||||
stderr=subprocess.STDOUT)
|
||||
if minversion:
|
||||
base = output.split("\n").strip()
|
||||
binary = os.path.join(base, "eslint")
|
||||
if not os.path.is_file(binary):
|
||||
binary = None
|
||||
except (subprocess.CalledProcessError, WindowsError):
|
||||
pass
|
||||
|
||||
if not binary:
|
||||
print(ESLINT_NOT_FOUND_MESSAGE)
|
||||
|
|
Загрузка…
Ссылка в новой задаче