Skip to content

Instantly share code, notes, and snippets.

@yurenju
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yurenju/9319829 to your computer and use it in GitHub Desktop.
Save yurenju/9319829 to your computer and use it in GitHub Desktop.
NODE_MODEULS_SRC?=modules.tar
ifdef NODE_MODULES_GIT_URL
NODE_MODULES_SRC := git-gaia-node-modules
endif
$(NODE_MODEULS_SRC):
ifeq "$(NODE_MODEULS_SRC)" "modules.tar"
$(DOWNLOAD_CMD) https://github.com/mozilla-b2g/gaia-node-modules/tarball/master
mv master "$(NODE_MODEULS_SRC)"
else
git clone "$(NODE_MODULES_GIT_URL)" "$(NODE_MODEULS_SRC)"
endif
node_modules: $(NODE_MODEULS_SRC)
ifeq "$(NODE_MODEULS_SRC)" "modules.tar"
$(TAR_WILDCARDS) --strip-components 1 -x -m -f $(NODE_MODEULS_SRC) "mozilla-b2g-gaia-node-modules-*/node_modules"
else
mv $(NODE_MODEULS_SRC)/node_modules node_modules
endif
npm install && npm rebuild
@echo "node_modules installed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment