Browse Source

started removing sourced check across all files

main
deicidus 2 years ago
parent
commit
24fe80cbbc
  1. 19
      spells/cantrips/cursor-blink
  2. 6
      spells/cantrips/fathom-cursor
  3. 6
      spells/cantrips/fathom-terminal
  4. 2
      spells/read-magic

19
spells/cantrips/cursor-blink

@ -14,14 +14,11 @@ cursor_blink_off() {
printf "\033[?25l" printf "\033[?25l"
} }
# Check if the script is being called from another script # If not, call the appropriate function based on the command line argument
if [ "${BASH_SOURCE[0]}" = "$0" ]; then if [ "$1" = "on" ]; then
# If not, call the appropriate function based on the command line argument cursor_blink_on
if [ "$1" = "on" ]; then elif [ "$1" = "off" ]; then
cursor_blink_on cursor_blink_off
elif [ "$1" = "off" ]; then else
cursor_blink_off echo "Usage: cast_cursor_blink on|off"
else fi
echo "Usage: cast_cursor_blink on|off"
fi
fi

6
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" 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 fathom_cursor "$@"
if [ "${BASH_SOURCE[0]}" = "$0" ]; then
# If not, call the function
fathom_cursor "$@"
fi

6
spells/cantrips/fathom-terminal

@ -63,8 +63,4 @@ test_fathom_terminal() {
assert_output "fathom_terminal --height --verbose --width" "Height: $(tput lines)\nWidth: $(tput cols)" assert_output "fathom_terminal --height --verbose --width" "Height: $(tput lines)\nWidth: $(tput cols)"
} }
# Check if the script is being called from another script fathom_terminal "$@"
if [ "${BASH_SOURCE[0]}" = "$0" ]; then
# If not, call the function
fathom_terminal "$@"
fi

2
spells/read-magic

@ -15,7 +15,7 @@ file=$1
attribute=$2 attribute=$2
# Check that the file exists # Check that the file exists
if [ ! -f "$file" ]; then if [ ! -f "$file" ] && [ ! -d "$file" ]; then
echo "Error: The file does not exist." echo "Error: The file does not exist."
exit 1 exit 1
fi fi

Loading…
Cancel
Save