Skip to content

Commit

Permalink
Merge pull request #5 from romw314/set-up-semaphore
Browse files Browse the repository at this point in the history
Set up semaphore
  • Loading branch information
romw314 authored Mar 23, 2024
2 parents 35964cb + 22f5139 commit 2d10761
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
21 changes: 21 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -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"
12 changes: 7 additions & 5 deletions uninstall.bash
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 2d10761

Please sign in to comment.