chore: dev deployment script improvements

This commit is contained in:
Zack Spear
2024-05-08 12:49:09 -07:00
committed by Zack Spear
parent 6b689ffcce
commit e3adc9a29a
2 changed files with 33 additions and 1 deletions

View File

@@ -1,5 +1,9 @@
#!/bin/bash
# Arguments
# $1: SSH server name
# $2: --wc-deploy / deploy web components w/o prompt
# Path to store the last used server name
state_file="$HOME/.deploy_state"
@@ -38,6 +42,26 @@ echo "$rsync_command"
eval "$rsync_command"
exit_code=$?
# if $2 is --wc-deploy, deploy the web components without prompting
if [ "$2" = "--wc-deploy" ]; then
deploy="yes"
fi
# if not deploy yes then ask
if [ -z "$deploy" ]; then
echo
echo
read -rp -e "Do you want to also deploy the built web components? (yes/no/build): " deploy
fi
if [ "$deploy" = "yes" ]; then
cd web || exit
npm run deploy-wc:dev
elif [ "$deploy" = "build" ]; then
cd web || exit
npm run build:dev
fi
# Play built-in sound based on the operating system
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS