Use grep -e instead of egrep and delete the package-lock.json if it exists before running npm install in the init.sh

This commit is contained in:
Kevin MacMartin 2017-09-26 15:32:25 -04:00
parent e89191027b
commit e4cab7cb86

View file

@ -74,7 +74,7 @@ php artisan route:clear
msg "Running: ${c_m}php artisan view:clear" msg "Running: ${c_m}php artisan view:clear"
php artisan view:clear php artisan view:clear
egrep -q '^CACHE_BUST=' .env || { grep -qe '^CACHE_BUST=' .env || {
msg "Adding the ${c_y}CACHE_BUST$c_w variable" msg "Adding the ${c_y}CACHE_BUST$c_w variable"
printf '\n%s\n' 'CACHE_BUST=' >> .env printf '\n%s\n' 'CACHE_BUST=' >> .env
} }
@ -87,6 +87,11 @@ sed -i 's|^CACHE_BUST=.*|CACHE_BUST='"$(tr -dc A-Za-z0-9 </dev/urandom | head -c
php artisan migrate || error "${c_m}php artisan migrate$c_w exited with an error status" php artisan migrate || error "${c_m}php artisan migrate$c_w exited with an error status"
} }
[[ -f package-lock.json ]] && {
msg "Deleting: ${c_y}package-lock.json$c_w"
rm package-lock.json
}
msg "Running: ${c_m}npm install" msg "Running: ${c_m}npm install"
npm prune && npm install --production || error "${c_m}npm prune && npm install --production$c_w exited with an error status" npm prune && npm install --production || error "${c_m}npm prune && npm install --production$c_w exited with an error status"