Hello Josh and Welcome to LQ!
so instead of always being able to call my function
it will only let me while I am in the directory the code initially is written in
IT looks like your executable is not in your $PATH. The following will tell you directories where you need to save the executable file
The output will give you a list of directories that make up $PATH. You can choose any one of these directories and save the shell script executable file. At this point you shouldnt have any restrictions on where you run the script from.
Hope that helps.