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

Side by Side Diff: common/eslint/bin/run_tests

Issue 2361623007: Add a run_eslint wrapper script (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import sys
8
9
10 _CATAPULT_PATH = os.path.abspath(
11 os.path.join(os.path.dirname(__file__),
12 os.path.pardir, os.path.pardir, os.path.pardir))
13
14
15 _ESLINT_PATH = os.path.abspath(
16 os.path.join(os.path.dirname(__file__), os.path.pardir))
17
18
19 def _RunTestsOrDie(top_level_dir):
20 exit_code = run_with_typ.Run(top_level_dir, path=[_ESLINT_PATH])
21 if exit_code:
22 sys.exit(exit_code)
23
24
25 def _AddToPathIfNeeded(path):
26 if path not in sys.path:
27 sys.path.insert(0, path)
28
29
30 if __name__ == '__main__':
31 _AddToPathIfNeeded(_CATAPULT_PATH)
32
33 from catapult_build import run_with_typ
34
35 _RunTestsOrDie(os.path.join(_ESLINT_PATH, 'eslint'))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698