deploy/npm

26 lines
303 B
Plaintext
Raw Normal View History

2021-04-14 18:28:56 +02:00
#!/usr/local/bin/bash
# $1 = source
# $2 = destination
# $3 = temp dir
# While another process is deploying
while [ -e "$3" ]
do
sleep 3
done
mkdir -p "$2" "$3"
git --work-tree="$3" --git-dir="$1" checkout -f
cd "$3"
npm install
npm run deploy
cp -r dist/ "$2"
chmod -R g+w "$2"
rm -rf "$3"