blob: 305411466c03cdc65d6bca929416b1510213608d [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')
14ESLINT_PATH = path.join(THIRD_PARTY_PATH, 'devtools-node-modules', 'third_party',
15 'node_modules', '.bin', 'eslint')
16
17try:
18 old_sys_path = sys.path[:]
19 sys.path.append(NODE_PATH)
20 import node
21finally:
22 sys.path = old_sys_path
23
24
25def node_path():
26 return node.GetBinaryPath()
27
28
29def eslint_path():
30 return ESLINT_PATH