Skip to content

Commit 84176c9

Browse files
committed
Add the ability to skip the rm -rf step in bower-install.sh and npm-install.sh.
This can speed up multiple install runs when making changes to bower and package requirements locally, where absolute perfect reproduction of the lock file may not be strictly necessary.
1 parent 2b44cfb commit 84176c9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Breaking and notable changes
22
===
33

4+
14 October 2021
5+
---
6+
7+
- Add the ability to skip the `rm -rf` step in `bower-install.sh` and `npm-install.sh`, when `bower.json` or `package.json` has changed, by exporting `BOWER_INSTALL_SH_SKIP_CLEAN=1` or `NPM_INSTALL_SH_SKIP_CLEAN=1`.
8+
49
6 April 2021
510
---
611

ixc_django_docker/bin/bower-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ touch "bower.json.md5.$UNAME"
2727

2828
if [[ ! -s "bower.json.md5.$UNAME" ]] || ! md5sum --status -c "bower.json.md5.$UNAME" > /dev/null 2>&1; then
2929
echo "Bower components in '$DIR' directory are out of date, 'bower.json' has been updated."
30-
if [[ -d bower_components ]]; then
30+
if [[ -d bower_components && -z ${BOWER_INSTALL_SH_SKIP_CLEAN+1} ]]; then
3131
rm -rf bower_components/*
3232
fi
3333
bower install --allow-root

ixc_django_docker/bin/npm-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ touch "package.json.md5.$UNAME"
2727

2828
if [[ ! -s "package.json.md5.$UNAME" ]] || ! md5sum --status -c "package.json.md5.$UNAME" > /dev/null 2>&1; then
2929
echo "Node modules in '$DIR' directory are out of date, 'package.json' has been updated."
30-
if [[ -d node_modules ]]; then
30+
if [[ -d node_modules && -z ${NPM_INSTALL_SH_SKIP_CLEAN+1} ]]; then
3131
rm -rf node_modules/*
3232
fi
3333
if [[ -f yarn.lock ]]; then

0 commit comments

Comments
 (0)