mirror of https://github.com/zulip/zulip.git
clean-npm-cache: Move up NODE_MODULES_CACHE_PATH for Travis.
This makes the code more readable and also will help simplify the patch when we switch to yarn.
This commit is contained in:
parent
1b7aee7cd6
commit
35a041c3bd
|
@ -10,13 +10,13 @@ from scripts.lib.node_cache import generate_sha1sum_node_modules
|
|||
|
||||
NODE_MODULES_CACHE_PATH = "/srv/zulip-npm-cache"
|
||||
if "--travis" in sys.argv:
|
||||
NODE_MODULES_CACHE_PATH = os.path.join(os.environ["HOME"], "zulip-npm-cache")
|
||||
try:
|
||||
subprocess.check_output(['npm', '--version'])
|
||||
except OSError:
|
||||
print('NPM not found. Most probably we are running static-analysis and '
|
||||
'hence npm is not installed. Exiting without cleaning npm cache.')
|
||||
sys.exit(0)
|
||||
NODE_MODULES_CACHE_PATH = os.path.join(os.environ["HOME"], "zulip-npm-cache")
|
||||
|
||||
sha1sum = generate_sha1sum_node_modules()
|
||||
npm_cache = os.path.join(NODE_MODULES_CACHE_PATH, sha1sum)
|
||||
|
|
Loading…
Reference in New Issue