mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +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():
|
||||
# type: () -> None
|
||||
subprocess.check_call(['tools/node', 'node_modules/.bin/handlebars']
|
||||
subprocess.check_call(['node', 'node_modules/.bin/handlebars']
|
||||
+ get_templates()
|
||||
+ ['--output', os.path.join(STATIC_PATH, 'templates/compiled.js'),
|
||||
'--known', 'if,unless,each,with'])
|
||||
|
||||
@@ -506,7 +506,7 @@ def run():
|
||||
@lint
|
||||
def jslint():
|
||||
# type: () -> int
|
||||
result = subprocess.call(['tools/node', 'tools/jslint/check-all.js']
|
||||
result = subprocess.call(['node', 'tools/jslint/check-all.js']
|
||||
+ by_lang['js'])
|
||||
return result
|
||||
|
||||
@@ -515,7 +515,7 @@ def run():
|
||||
# type: () -> int
|
||||
if len(by_lang['js']) == 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'])
|
||||
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():
|
||||
# type: () -> None
|
||||
"""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'])
|
||||
|
||||
def run_watch(port):
|
||||
# type: (str) -> None
|
||||
"""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])
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
Reference in New Issue
Block a user