Files
react-native-devtools-frontend/scripts/local_node.py
T
Jeff Fisher a1d0db6496 DevTools: Fix presubmit scripts on Windows
This fixes a couple presubmit issues when running on Windows:

* check_gn didn't properly normalize paths
* eslint didn't execute in node successfully since the bin style for the
npm install was unix specific (it's a CMD file on Windows)


Bug: 929919
Change-Id: Iec7e1057254047bd0a6539e16df964dc8a58d528
Reviewed-on: https://chromium-review.googlesource.com/c/1459576
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#633810}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d2dcac5ced285df053bc094b8e36d80a998f0079
2019-02-20 18:56:14 +00:00

30 lines
787 B
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')
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