diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml new file mode 100644 index 0000000..a3bf669 --- /dev/null +++ b/.semaphore/semaphore.yml @@ -0,0 +1,21 @@ +version: v1.0 +name: test +agent: + machine: + type: e1-standard-2 + os_image: ubuntu2004 +blocks: + - name: Main + task: + prologue: + commands: + - checkout + - bash install.bash + jobs: + - name: Install + commands: + - bash --rcfile "$HOME"/.bashrc -ic "which bashfox" + - name: Uninstall + commands: + - UBFORCE=1 bash uninstall.bash + - bash --rcfile "$HOME"/.bashrc -ic "! which bashfox" diff --git a/uninstall.bash b/uninstall.bash index 87ff03c..1fbacec 100755 --- a/uninstall.bash +++ b/uninstall.bash @@ -1,10 +1,12 @@ #!/bin/bash echo "UNINSTALLING BASHFOX" -randstr="$(base64 /dev/urandom -w6 | grep -v '/' | head -n1)" -echo -echo "--- CHECK ---" -read -p "Enter $randstr to proceed: " check -[ "$check" = "$randstr" ] || ( echo "Abort" && exit ) +if [ ! "$UBFORCE" ]; then + randstr="$(base64 /dev/urandom -w6 | grep -v '/' | head -n1)" + echo + echo "--- CHECK ---" + read -p "Enter $randstr to proceed: " check + [ "$check" = "$randstr" ] || ( echo "Abort" && exit ) +fi echo echo "--- UNINSTALL ---" rm -vrf ~/.bashfox