mirror of https://github.com/gorhill/uBlock.git
Save/restore node_modules dependencies if present
To avoid hacing to fetch them all over again each time we launch the test suite.
This commit is contained in:
parent
fd9888f85e
commit
6c4472ce7f
|
@ -6,6 +6,13 @@ set -e
|
|||
|
||||
DES=dist/build/uBlock0.nodejs
|
||||
|
||||
# Save existing npm dependencies if present so that we do not have to fetch
|
||||
# them all again
|
||||
if [ -d "$DES/node_modules" ]; then
|
||||
TMPDIR=`mktemp -d`
|
||||
mv "$DES/node_modules" "$TMPDIR/node_modules"
|
||||
fi
|
||||
|
||||
rm -rf $DES
|
||||
|
||||
mkdir -p $DES/js
|
||||
|
@ -72,4 +79,10 @@ else
|
|||
fi
|
||||
cd -
|
||||
|
||||
# Restore saved npm dependencies
|
||||
if [ -n "$TMPDIR" ]; then
|
||||
mv "$TMPDIR/node_modules" "$DES/node_modules"
|
||||
rmdir "$TMPDIR"
|
||||
fi
|
||||
|
||||
echo "*** uBlock0.nodejs: Package done."
|
||||
|
|
Loading…
Reference in New Issue