I have been looking into bash and shell and have been trying to figure out how Git is able to run its C script in any directory. I have recently fiddled with environment variables, although this just redirects you to run a script in the location of that file, plus you have the $. How is Git able to integrate its scripts into the terminal? How would I be able to do the same with an arbitrary script in python?
It is really hard to find any information without knowing the correct terminology although here's my attempt of mimicking such a command line system as git.
I start with a command file in a folder in my home directory
something.command
Which on the inside directs me to a python script. e.g
cd
cd python_script_location
python3 script.py
Then I make this an environment variable through editing the .bash_profile.
export pyinit=/Users/Charlkie/vcscmd/pyinit.command
This although will just run a script in another directory. How can I make a terminal command that runs a python script in the current directory? Any help would be greatly appreciated :)