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
|
# /etc/profile.d/sum.sh
|
||||||
|
|
||||||
# Ensure the script is sourced, not executed
|
# Ensure the script is sourced, not executed
|
||||||
if [ -n "$ZSH_VERSION" ]; then
|
if [[ "$0" == "${BASH_SOURCE[0]}" ]] || [[ "$0" == "${(%):-%x}" ]]; then
|
||||||
# For zsh
|
echo "This script should be sourced, not executed."
|
||||||
if [[ "${(%):-%x}" == "$0" ]]; then
|
return 1 2>/dev/null || exit 1
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Function to generate SHA-256 hashes for .sh files in a given directory
|
# Function to generate SHA-256 hashes for .sh files in a given directory
|
||||||
|
|
Loading…
Reference in New Issue