blob: 25a378ccd5c07dbb2a0b03c2f33a5f4fe0b6decd [file] [log] [blame]
Blink Reformat4c46d092018-04-07 15:32:37 +00001# Copyright 2017 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4"""
5Thin wrapper around the local node.js installed as part of chromium DEPS
6"""
7
8from os import path
9import sys
10
11SCRIPTS_PATH = path.dirname(path.abspath(__file__))
12THIRD_PARTY_PATH = path.join(SCRIPTS_PATH, '..', '..', '..', '..')
13NODE_PATH = path.join(THIRD_PARTY_PATH, 'node')
Jeff Fishera1d0db62019-02-20 18:56:14 +000014ESLINT_PATH = path.join(THIRD_PARTY_PATH, 'devtools-node-modules', 'third_party', 'node_modules', 'eslint', 'bin', 'eslint.js')
Paul Lewise441d1d2019-09-16 14:40:20 +000015KARMA_PATH = path.join(THIRD_PARTY_PATH, 'devtools-node-modules', 'third_party', 'node_modules', 'karma', 'bin', 'karma')
16NODE_MODULES_PATH = path.join(THIRD_PARTY_PATH, 'devtools-node-modules', 'third_party', 'node_modules')
Blink Reformat4c46d092018-04-07 15:32:37 +000017
18try:
19 old_sys_path = sys.path[:]
20 sys.path.append(NODE_PATH)
21 import node
22finally:
23 sys.path = old_sys_path
24
25
26def node_path():
27 return node.GetBinaryPath()
28
29
30def eslint_path():
31 return ESLINT_PATH
Paul Lewise441d1d2019-09-16 14:40:20 +000032
33
34def karma_path():
35 return KARMA_PATH
36
37
38def node_modules_path():
39 return NODE_MODULES_PATH