Chose one or the other file according to your preference (Mac/Unix)
chmod +x <filename>=> To make it executable./bash.js foo=> will create a repositoryfooand a filefoo/index.html./bash.sh bar=> will create a repositorybarand a filebar/index.html
Now it will run only in the current directory. If you want to run it globally on your computer
Use a name without extension:
mv cmd.js cmdormv cmd.sh cmdpwd=> to get your current directory.export PATH=$PATH:<pwd result>/cmd
Now in this terminal, you can always use your command like:
cmd baz=> will create a repositorybazand a filebaz/index.html
But it will work only on this terminal, so use:
- Move your
cmdfile in one of your main directories. e.g:~/scriptsfolder - Open the
~/.bash_profile(depending on your terminal you might need to open one of this other file in the section Set your PATH permanently) - Add to the line
export PATH(if not already there):export PATH=$PATH:/Users/<username>/scripts/cmd