Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Unified Diff: common/eslint/bin/run_eslint

Issue 2361623007: Add a run_eslint wrapper script (Closed)
Patch Set: Checkpoint. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: common/eslint/bin/run_eslint
diff --git a/systrace/bin/systrace b/common/eslint/bin/run_eslint
similarity index 50%
copy from systrace/bin/systrace
copy to common/eslint/bin/run_eslint
index bce86a7fd1460a4c3b82d3c72dccc26682acf497..4fe98971f48240e3264e78405a21170b9da86b5e 100755
--- a/systrace/bin/systrace
+++ b/common/eslint/bin/run_eslint
@@ -1,5 +1,4 @@
#!/usr/bin/env python
-
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -7,10 +6,21 @@
import os
import sys
-_SYSTRACE_DIR = os.path.abspath(
+
+_ESLINT_PATH = os.path.abspath(
os.path.join(os.path.dirname(__file__), os.path.pardir))
-sys.path.insert(0, _SYSTRACE_DIR)
-from systrace import run_systrace
+
+
+def _AddToPathIfNeeded(path):
+ if path not in sys.path:
+ sys.path.insert(0, path)
+
if __name__ == '__main__':
- sys.exit(run_systrace.main())
+ _AddToPathIfNeeded(_ESLINT_PATH)
+ from eslint import eslint
+
+ if len(sys.argv) == 1:
+ print eslint.RunEslintGlobal()
+ else:
+ print eslint.RunEslint(sys.argv[1:])

Powered by Google App Engine
This is Rietveld 408576698