mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 07:52:19 +00:00
tools: Remove tools/node and call node directly instead.
Previously, we didn't install/pin our own node.js version, and thus had this wrapper script to manage it. Now that install our own node via nvm, there's no reason we still need this. Fixes #2409.
This commit is contained in:
committed by
Tim Abbott
parent
25c6b9f586
commit
f0df1db9fb
@@ -24,7 +24,7 @@ def get_templates():
|
|||||||
|
|
||||||
def run():
|
def run():
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
subprocess.check_call(['tools/node', 'node_modules/.bin/handlebars']
|
subprocess.check_call(['node', 'node_modules/.bin/handlebars']
|
||||||
+ get_templates()
|
+ get_templates()
|
||||||
+ ['--output', os.path.join(STATIC_PATH, 'templates/compiled.js'),
|
+ ['--output', os.path.join(STATIC_PATH, 'templates/compiled.js'),
|
||||||
'--known', 'if,unless,each,with'])
|
'--known', 'if,unless,each,with'])
|
||||||
|
|||||||
@@ -506,7 +506,7 @@ def run():
|
|||||||
@lint
|
@lint
|
||||||
def jslint():
|
def jslint():
|
||||||
# type: () -> int
|
# type: () -> int
|
||||||
result = subprocess.call(['tools/node', 'tools/jslint/check-all.js']
|
result = subprocess.call(['node', 'tools/jslint/check-all.js']
|
||||||
+ by_lang['js'])
|
+ by_lang['js'])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@@ -515,7 +515,7 @@ def run():
|
|||||||
# type: () -> int
|
# type: () -> int
|
||||||
if len(by_lang['js']) == 0:
|
if len(by_lang['js']) == 0:
|
||||||
return 0
|
return 0
|
||||||
result = subprocess.call(['tools/node', 'node_modules/.bin/eslint', '--quiet']
|
result = subprocess.call(['node', 'node_modules/.bin/eslint', '--quiet']
|
||||||
+ by_lang['js'])
|
+ by_lang['js'])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
12
tools/node
12
tools/node
@@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Wrapper for node which finds the right binary.
|
|
||||||
|
|
||||||
if which nodejs >/dev/null 2>&1; then
|
|
||||||
# Name used by Debian etc.
|
|
||||||
exec nodejs "$@"
|
|
||||||
else
|
|
||||||
# Name used by upstream
|
|
||||||
exec node "$@"
|
|
||||||
fi
|
|
||||||
@@ -16,13 +16,13 @@ STATIC_PATH = 'static/'
|
|||||||
def run():
|
def run():
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
"""Builds for production, writing the output to disk"""
|
"""Builds for production, writing the output to disk"""
|
||||||
subprocess.check_call(['tools/node', 'node_modules/.bin/webpack'] +
|
subprocess.check_call(['node', 'node_modules/.bin/webpack'] +
|
||||||
['--config', 'tools/webpack.production.config.js'])
|
['--config', 'tools/webpack.production.config.js'])
|
||||||
|
|
||||||
def run_watch(port):
|
def run_watch(port):
|
||||||
# type: (str) -> None
|
# type: (str) -> None
|
||||||
"""watches and rebuilds on changes, serving files from memory via webpack-dev-server"""
|
"""watches and rebuilds on changes, serving files from memory via webpack-dev-server"""
|
||||||
subprocess.Popen(['tools/node', 'node_modules/.bin/webpack-dev-server'] +
|
subprocess.Popen(['node', 'node_modules/.bin/webpack-dev-server'] +
|
||||||
['--config', 'tools/webpack.config.js', '--watch-poll', '--port', port])
|
['--config', 'tools/webpack.config.js', '--watch-poll', '--port', port])
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
|||||||
Reference in New Issue
Block a user