diff --git a/spells/cantrips/cursor-blink b/spells/cantrips/cursor-blink index 7d3d462..7807c42 100755 --- a/spells/cantrips/cursor-blink +++ b/spells/cantrips/cursor-blink @@ -14,14 +14,11 @@ cursor_blink_off() { printf "\033[?25l" } -# Check if the script is being called from another script -if [ "${BASH_SOURCE[0]}" = "$0" ]; then - # If not, call the appropriate function based on the command line argument - if [ "$1" = "on" ]; then - cursor_blink_on - elif [ "$1" = "off" ]; then - cursor_blink_off - else - echo "Usage: cast_cursor_blink on|off" - fi -fi \ No newline at end of file +# If not, call the appropriate function based on the command line argument +if [ "$1" = "on" ]; then +cursor_blink_on +elif [ "$1" = "off" ]; then +cursor_blink_off +else +echo "Usage: cast_cursor_blink on|off" +fi diff --git a/spells/cantrips/fathom-cursor b/spells/cantrips/fathom-cursor index edcf656..e7f60bf 100755 --- a/spells/cantrips/fathom-cursor +++ b/spells/cantrips/fathom-cursor @@ -57,8 +57,4 @@ test_fathom_cursor() { assert_equal "$(./fathom-cursor)" "$(./fathom-cursor -x -y)" "fathom_cursor and -x -y outputs differ" } -# Check if the script is being called from another script -if [ "${BASH_SOURCE[0]}" = "$0" ]; then - # If not, call the function - fathom_cursor "$@" -fi +fathom_cursor "$@" diff --git a/spells/cantrips/fathom-terminal b/spells/cantrips/fathom-terminal index 39309c0..5878dfb 100755 --- a/spells/cantrips/fathom-terminal +++ b/spells/cantrips/fathom-terminal @@ -63,8 +63,4 @@ test_fathom_terminal() { assert_output "fathom_terminal --height --verbose --width" "Height: $(tput lines)\nWidth: $(tput cols)" } -# Check if the script is being called from another script -if [ "${BASH_SOURCE[0]}" = "$0" ]; then - # If not, call the function - fathom_terminal "$@" -fi +fathom_terminal "$@" diff --git a/spells/read-magic b/spells/read-magic index 765799c..132209f 100755 --- a/spells/read-magic +++ b/spells/read-magic @@ -15,7 +15,7 @@ file=$1 attribute=$2 # Check that the file exists -if [ ! -f "$file" ]; then +if [ ! -f "$file" ] && [ ! -d "$file" ]; then echo "Error: The file does not exist." exit 1 fi