fixup
This commit is contained in:
parent
ca8249e079
commit
3cda18fef6
15
src/sum.sh
15
src/sum.sh
|
@ -1,18 +1,9 @@
|
|||
# /etc/profile.d/sum.sh
|
||||
|
||||
# Ensure the script is sourced, not executed
|
||||
if [ -n "$ZSH_VERSION" ]; then
|
||||
# For zsh
|
||||
if [[ "${(%):-%x}" == "$0" ]]; then
|
||||
echo "This script should be sourced, not executed."
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
# For bash
|
||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||
echo "This script should be sourced, not executed."
|
||||
return 1
|
||||
fi
|
||||
if [[ "$0" == "${BASH_SOURCE[0]}" ]] || [[ "$0" == "${(%):-%x}" ]]; then
|
||||
echo "This script should be sourced, not executed."
|
||||
return 1 2>/dev/null || exit 1
|
||||
fi
|
||||
|
||||
# Function to generate SHA-256 hashes for .sh files in a given directory
|
||||
|
|
Loading…
Reference in New Issue