Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #246 from Financial-Times/revise-install-task-to-u…
Browse files Browse the repository at this point in the history
…se-npm-ci-command

Revise install task to use 'npm ci' command
  • Loading branch information
andygout authored Nov 25, 2020
2 parents 7e9a908 + 555bd29 commit 160372f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tasks/install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ instal%: node_modules bower_components dotfiles
# INSTALL SUB-TASKS
IS_GIT_IGNORED = grep -q $(if $1, $1, $@) .gitignore

# if package-lock.json is in gitignore, don't create it, and prune
# before install to match the behaviour with package-lock.json
# If package-lock.json is in .gitignore, don't create it, and prune before install to match the behaviour with package-lock.json;
# else if in a CI environment and a package-lock.json exists, use the `npm ci` command to freshly install node_modules from package-lock.json;
# else run `npm install`.
define NPM_INSTALL
if $(call IS_GIT_IGNORED,package-lock.json); then \
npm prune --no-production --no-package-lock \
&& npm install --no-package-lock ;\
elif [ ! -z $(CIRCLECI) ] && [ -e package-lock.json ]; then \
npm ci ;\
else \
npm install ;\
fi
Expand Down

0 comments on commit 160372f

Please sign in to comment.