diff --git a/setup.sh b/setup.sh index 182a51a..89dcf28 100755 --- a/setup.sh +++ b/setup.sh @@ -50,8 +50,8 @@ sworkflow_update_files() { echo "sworkflow: Updating files" echo "sworkflow: Fetching Updates" - git clone --depth 1 https://github.com/danascape/sworkflow /tmp/sworkflow - cd /tmp/sworkflow + git clone --depth 1 https://github.com/danascape/sworkflow /tmp/sworkflow || trigger_error + cd /tmp/sworkflow || trigger_error ./setup.sh i rm -rf /tmp/sworkflow } @@ -66,6 +66,7 @@ sworkflow_synchronize_files() if [[ -z "$(which bash)" ]]; then echo "error: No bash" + trigger_error else if [[ -f "$HOME/.bashrc" ]]; then update_path '.bashrc' @@ -75,6 +76,12 @@ sworkflow_synchronize_files() fi } +trigger_error() +{ + echo "sworkflow: Failed to install" + exit 1 +} + update_path() { local shellrc=${1:-'.bashrc'}