6 ms·
I get it because I do something similar: I discover I have some command (`annoyingly long but repeatable command `) that I run in a particular repo (`repo\over\
by IggleSniggle 6y ago
I get it because I do something similar: I discover I have some command (`annoyingly long but repeatable command `) that I run in a particular repo (`repo\over\there`) frequently. For me, I then alias switching to that repo with a 1-3 letter sequence: `rot` and the command to `alc` (annoyingly long but repeatable command). Often I want these to be semipermanent so the aliases are added to my bashrc.
This project looks like it is streamlining and organizing-per-project this kind of workflow / preference for short aliases, with helpful conventions like "?" that act sort of like a tab-completion hint.
- LeonB 6y agoYou might like ok-bash. (https://github.com/secretGeek/ok-bash https://github.com/secretGeek/ok-bash) In any folder, you put all your favorite One-liners for that folder into a file called “.ok”. Then you can run them command with “ok 1” for the first command, or “ok 2” for the second command, etc. Use “ok” by itself to pretty-print all the available commands in that folder. I started the project but my friend @doekeman took it waaay further than I ever dreamed. It’s really helpful if you have a bunch of different projects that you work on, and need a way to remember all their different commands and incantations. There’s a Powershell version too (ok-ps). For there bit where I jump around from one project to another I use a system called markjump. It’s great too.
- Kaze404 6y agoSeems pretty useful, but isn't that basically a makefile?
- LeonB 6y agoLol. I have heard that from people who haven’t used it. It’s lighter-weight. Not as cryptic. Can also hook it up to your makefile targets, make them easier to access. The other thing people say is “isn’t that same as npm scripts?” — it can complement those as well. I modify “cd” so that on entering any folder it shows me the available .ok commands, if any.
- majewsky 6y agoMakefiles aren't cryptic if all you need is some-name: some command
- eterps 6y agoMakefile:2: * missing separator. Stop. But yeah, other than that Makefiles aren't cryptic :)
- LeonB 6y agoHave you shown a “getting started with makefiles” guide to a team member who is brought in to help with documentation or accessibility or pretty much anything other than development? It is cryptic in the true sense of the word. And yet, ok files are not a competitor to makefiles. Use both together.
- Kaze404 6y agoI literally wrote my first makefile today after posting the original comment and had no issues.
- sorbits 6y agoIt’s lighter-weight. Not as cryptic. Can also hook it up to your makefile targets, make them easier to access. The only additional “weight” in the Makefile would be the name of the target, where you leave it out and have it default to 1, 2, … n, which I would argue is more cryptic, as “make build” or “make deploy” is always doing that action, whereas “ok 2” could be deploy in one folder, and push in another. As for easy access, most shells should offer you tab completion for the Makefile’s targets, and your development environment may also pick up the existence of the Makefile and offer a way to run the targets. Additionally Makefiles allow to setup dependencies, for example in your ok file example you have ./build.sh and ./deploy.sh as two actions: Clearly build should be a dependency of deploy, so “make deploy” implies building, rather than having to always do “ok 1 && ok 2”. Lastly there is the ability to do dry-runs with Makefiles, once you start to setup dependencies…