Comment by andrewmcwatters
2 years ago
Hey Aditya, you can make your command a little more unix-y if you feel so compelled by just renaming `shite.sh' to `shite' and run the shell script as a utility since it's already `chmod +x`'d.
Then you can `shite(1)` anywhere you want after you put the command in your PATH and feel like a proper `git(1)`.
Good `shite(1)` mate. Love it.
Sidelight: I tend to use functions as Unix tools a lot more than scripts as Unix tools. No need for PATH twiddling, file ownership/permission setting, among other things. I wrote about it here: https://www.evalapply.org/posts/shell-aint-a-bad-place-to-fp...
I do this too! Bash functions are incredible. They have to be the most awesome under-used function (pun intended) I know of
Ah a fellow person of culture :D
Maybe you will enjoy my "bash-toolkit" repo: https://github.com/adityaathalye/bash-toolkit which I've dubbed my "Swiss Army Toolkit" of functions-as-cmd-line-tools and useful-to-me patterns.
Which reminds me, I've collected more and should update the repo!
Thank you for the review! If only you knew of all the glorious plans :,)
Apropos your note, may I direct you to "Unrealised Ambitions" in the README https://github.com/adityaathalye/shite#unrealised-ambitions
> Apropos your note, may I direct you to "Unrealised Ambitions" in the README https://github.com/adityaathalye/shite#unrealised-ambitions
It doesn't have to be an unrealized ambition with a simple `mv` command ;)
I like this as a user but it always throws me off when I see it in a Git repo, where I'd prefer the .sh extension to hint at what's inside the file.
Indeed, this is why I retained the `.sh`.
If it were designed as a proper userspace tool (it is not, and may never be), I might have dropped the file extension. But I might also have chosen to keep the `.sh`, and create an alias instead, during install. That way I get to have both micro-conveniences.
For reference, I think npm does this too, and IIRC, they just symlink the utility name.