Use local tmp directory (#3821)

This commit is contained in:
Manish Jethani 2021-08-14 22:25:20 +05:30 committed by GitHub
parent bafe824f09
commit bd8cb8d50f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -6,10 +6,12 @@ set -e
DES=dist/build/uBlock0.nodejs
TMPDIR=tmp
mkdir -p $TMPDIR
# 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
@ -81,7 +83,6 @@ cd -
# Restore saved npm dependencies
if [ -d "$TMPDIR/node_modules" ]; then
mv "$TMPDIR/node_modules" "$DES/node_modules"
rmdir "$TMPDIR"
fi
echo "*** uBlock0.nodejs: Package done."