Bug 1353385 - Make './mach eslint --setup' a little quieter and fix the reported location of the eslint binary. r=mossop

MozReview-Commit-ID: 3ucPJP5JXV8

--HG--
extra : rebase_source : ba9f2f1b79e6bbdbf20884ec01d095bd40f8c3c3
This commit is contained in:
Mark Banner 2017-04-04 16:06:14 +01:00
Родитель 0d16807831
Коммит 2cc135d612
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -78,8 +78,11 @@ def eslint_setup():
if not npm_path:
return 1
extra_parameters = [ "--loglevel=error" ]
# Install ESLint and external plugins
cmd = [npm_path, "install"]
cmd.extend(extra_parameters)
print("Installing eslint for mach using \"%s\"..." % (" ".join(cmd)))
if not call_process("eslint", cmd):
return 1
@ -87,20 +90,20 @@ def eslint_setup():
# Install in-tree ESLint plugin mozilla.
cmd = [npm_path, "install",
os.path.join(module_path, "eslint-plugin-mozilla")]
cmd.extend(extra_parameters)
print("Installing eslint-plugin-mozilla using \"%s\"..." % (" ".join(cmd)))
if not call_process("eslint-plugin-mozilla", cmd):
return 1
eslint_path = os.path.join(module_path, "node_modules", ".bin", "eslint")
# Install in-tree ESLint plugin spidermonkey.
cmd = [npm_path, "install",
os.path.join(module_path, "eslint-plugin-spidermonkey-js")]
cmd.extend(extra_parameters)
print("Installing eslint-plugin-spidermonkey-js using \"%s\"..." % (" ".join(cmd)))
if not call_process("eslint-plugin-spidermonkey-js", cmd):
return 1
eslint_path = os.path.join(module_path, "node_modules", ".bin", "eslint")
eslint_path = os.path.join(get_project_root(), "node_modules", ".bin", "eslint")
print("\nESLint and approved plugins installed successfully!")
print("\nNOTE: Your local eslint binary is at %s\n" % eslint_path)