3 ms·
But you already understand makefiles, so try using both What is it that ok files can do that Makefiles don’t? I don’t buy your complexity argument, a Makefile
by sorbits 6y ago
But you already understand makefiles, so try using both
What is it that ok files can do that Makefiles don’t?
I don’t buy your complexity argument, a Makefile can be as simple as:
1:
./build.sh
Now you can run “make 1” and you have the same as “ok 1”.
Although most people would name this “build” rather than “1”, so you “make build”.
And the equivalent ok file would be:
build: ./build.sh
So the only syntactical difference is that make require a newline after the colon.
- LeonB 6y agoI modify “cd” so that every time I change directory it calls “ok” and thus I get a pretty print of the most useful 1-line commands for that folder. I have .ok in all my projects. Some of those have makefiles, some have cake, some have grunt, some have npm scripts. Many are pure documentation folders (books etc). ok isn’t primarily a build system or a task runner, it’s a folder profile. Asking “what can x do that y cannot do?” invokes the Turing tarpit. A better question is “why is it more pleasant to use x with or instead of y?” ...particularly since they can be used together.
- doekezanstra 6y agoThe thing ok can do what make can't, is work on the current shell. With ok, you can: * navigate to another folder/directory * set an environment variable I use both make and ok. For me, if I want to "make" stuff, I use make (compile, sign, zip, deploy etc.). The ok-files, I use for ad-hoc stuff, like viewing log files). It's also a good command's I can't seem to remember. A bit less structured. So I guess it's not only a technical difference, but also a slightly conceptual difference. I must say I do have a lot of (rather) small git-repo's I work on. And not every day. So when I switch to some kind of project, it helps me work faster. But your situation might differ...