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

Unified Diff: common/eslint/eslint/__init__.py

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/eslint/__init__.py
diff --git a/common/eslint/eslint/__init__.py b/common/eslint/eslint/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..bd6c184c766d30ccfd2eabeb9f6aa1ea768207db
--- /dev/null
+++ b/common/eslint/eslint/__init__.py
@@ -0,0 +1,24 @@
+# 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.
+
+import os
+import sys
+
+
+_CATAPULT_PATH = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ os.path.pardir, os.path.pardir, os.path.pardir)
+
+
+def _AddToPathIfNeeded(path):
+ if path not in sys.path:
+ sys.path.insert(0, path)
+
+
+def _UpdateSysPathIfNeeded():
+ _AddToPathIfNeeded(os.path.join(_CATAPULT_PATH, 'common', 'node_runner'))
+ _AddToPathIfNeeded(os.path.join(_CATAPULT_PATH, 'common', 'py_utils'))
+
+
+_UpdateSysPathIfNeeded()

Powered by Google App Engine
This is Rietveld 408576698