From bb4df5cf9bc8f87bc9125a3fc0bab4f5b66a925a Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Wed, 21 Jun 2023 16:06:08 -0500 Subject: [PATCH] refactor(plg): test deploy script --- plugin/scripts/deploy-dev.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/plugin/scripts/deploy-dev.sh b/plugin/scripts/deploy-dev.sh index d3a853801..751c16860 100755 --- a/plugin/scripts/deploy-dev.sh +++ b/plugin/scripts/deploy-dev.sh @@ -34,5 +34,21 @@ rsync_command="rsync -avz --progress --stats -m -e ssh \"$source_directory/\" \" echo "Executing the following command:" echo "$rsync_command" -# Execute the rsync command +# Execute the rsync command and capture the exit code eval "$rsync_command" +exit_code=$? + +# Play built-in sound based on the operating system +if [[ "$OSTYPE" == "darwin"* ]]; then + # macOS + afplay /System/Library/Sounds/Glass.aiff +elif [[ "$OSTYPE" == "linux-gnu" ]]; then + # Linux + paplay /usr/share/sounds/freedesktop/stereo/complete.oga +elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then + # Windows + powershell.exe -c "(New-Object Media.SoundPlayer 'C:\Windows\Media\Windows Default.wav').PlaySync()" +fi + +# Exit with the rsync command's exit code +exit $exit_code \ No newline at end of file