Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Commit

Permalink
Update dist-common.sh to work in more situations
Browse files Browse the repository at this point in the history
  • Loading branch information
skullydazed committed Jul 8, 2017
1 parent 1c435cb commit 86b3f0b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions dist-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@ if ! [ -d dfu -a -d src ]; then
exit 1
fi

if [ $(($(date +%s) - $(stat -f %c node_modules))) -gt 3600 ]; then
npm uninstall -g electron-packager
if [ -d node_modules ]; then
if [ $(($(date +%s) - $(stat -f %c node_modules))) -gt 3600 ]; then
npm uninstall -g electron-packager
fi
echo '*** About to wipe out the "node_modules" directory.'
echo '*** You have 5 seconds to press Ctrl-C!'
for i in 5 4 3 2 1; do
echo "*** $i"
sleep 1
done
rm -r node_modules
fi
echo '*** About to wipe out the "node_modules" directory.'
echo '*** You have 5 seconds to press Ctrl-C!'
for i in 5 4 3 2 1; do
echo "*** $i"
sleep 1
done
rm -r node_modules

if ! npm list -g electron-packager 2>&1 > /dev/null; then
echo '*** Installing prerequisite electron-packager globally.'
Expand Down

0 comments on commit 86b3f0b

Please sign in to comment.