op.sh: check for valid invocation (#33166)

no source
pull/33167/head
Maxime Desroches 10 months ago committed by GitHub
parent 7ee9d2d1b9
commit d0671bda6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      tools/op.sh

@ -1,5 +1,11 @@
#!/usr/bin/env bash
if [[ ! "${BASH_SOURCE[0]}" = "${0}" ]]; then
echo "Invalid invocation! This script must not be sourced."
echo "Run 'op.sh' directly or check your .bashrc for a valid alias"
return 0
fi
set -e
RED='\033[0;31m'

Loading…
Cancel
Save