From 59dce062eb4688d7aed69cb9b33a681eef987caa Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Tue, 14 Jan 2025 01:18:44 +0530 Subject: [PATCH] Add SVN as a part of the workflow --- deploy.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/deploy.sh b/deploy.sh index 4294120..d0aef50 100755 --- a/deploy.sh +++ b/deploy.sh @@ -4,6 +4,32 @@ # doesn't match I want to be able to show an error first set -eo +# Function to check if a command exists +command_exists() { + command -v "$1" >/dev/null 2>&1 +} + +# Check if SVN is installed +if command_exists svn; then + echo "SVN is already installed." +else + echo "SVN is not installed. Installing SVN..." + + # Update the package list + sudo apt-get update -y + + # Install SVN + sudo apt-get install -y subversion + + # Verify installation + if command_exists svn; then + echo "SVN was successfully installed." + else + echo "Failed to install SVN. Please check your system configuration." + exit 1 + fi +fi + # Ensure SVN username and password are set # IMPORTANT: while secrets are encrypted and not viewable in the GitHub UI, # they are by necessity provided as plaintext in the context of the Action,