mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 01:07:01 +08:00
Change-Id: I1ea19eee040360d3a73ffaa72ccf15bceff80317 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1806858 Auto-Submit: Paul Lewis <aerotwist@google.com> Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Paul Lewis <aerotwist@google.com> Cr-Original-Commit-Position: refs/heads/master@{#696789} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: a163f8024d6cdf3c5ddb0ca5ac0468ec73d9a576
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
# Copyright 2017 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.
|
|
"""
|
|
Thin wrapper around the local node.js installed as part of chromium DEPS
|
|
"""
|
|
|
|
from os import path
|
|
import sys
|
|
|
|
SCRIPTS_PATH = path.dirname(path.abspath(__file__))
|
|
THIRD_PARTY_PATH = path.join(SCRIPTS_PATH, '..', '..', '..', '..')
|
|
NODE_PATH = path.join(THIRD_PARTY_PATH, 'node')
|
|
ESLINT_PATH = path.join(THIRD_PARTY_PATH, 'devtools-node-modules', 'third_party', 'node_modules', 'eslint', 'bin', 'eslint.js')
|
|
KARMA_PATH = path.join(THIRD_PARTY_PATH, 'devtools-node-modules', 'third_party', 'node_modules', 'karma', 'bin', 'karma')
|
|
NODE_MODULES_PATH = path.join(THIRD_PARTY_PATH, 'devtools-node-modules', 'third_party', 'node_modules')
|
|
|
|
try:
|
|
old_sys_path = sys.path[:]
|
|
sys.path.append(NODE_PATH)
|
|
import node
|
|
finally:
|
|
sys.path = old_sys_path
|
|
|
|
|
|
def node_path():
|
|
return node.GetBinaryPath()
|
|
|
|
|
|
def eslint_path():
|
|
return ESLINT_PATH
|
|
|
|
|
|
def karma_path():
|
|
return KARMA_PATH
|
|
|
|
|
|
def node_modules_path():
|
|
return NODE_MODULES_PATH
|