diff --git a/script/ghci b/script/ghci new file mode 100755 index 0000000..c625515 --- /dev/null +++ b/script/ghci @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# +# Open GitHub CI for the current branch + +set -e + +export GH_NO_UPDATE_NOTIFIER=1 + +ghoutput=$(gh pr checks) +if [ ! $exitcode -eq 0 ]; then + exit 1 +fi + +url=$(echo $ghoutput | grep -o 'https://.*?' | tr -d '?') + +if [ $(uname -s) = "Linux" ]; then + progname="xdg-open" +else + progname="open" # macOS +fi + +eval "$progname $url"