blob: 35ad2c9663c500e0b8e7c0165d14ce59fa19c324 [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')
Blink Reformat4c46d092018-04-07 15:32:37 +000015
16try:
17 old_sys_path = sys.path[:]
18 sys.path.append(NODE_PATH)
19 import node
20finally:
21 sys.path = old_sys_path
22
23
24def node_path():
25 return node.GetBinaryPath()
26
27
28def eslint_path():
29 return ESLINT_PATH