News for hackers. Stuff that matters.
Re:How did I run that code again? Tools to help recall by zelphirkalt on Friday January 28, 2022 @07:39AM (#30113838)
My favorite tool for remembering how to run something, or rather for not having to remember: A simple Makefile and a readme file.
Re:How did I run that code again? Tools to help recall by dividedbyzero on Friday January 28, 2022 @09:25AM (#30114948)
I've been using make to do this for ages, but its syntax really shows its age in a bad way. A while ago I switched to just (https://github.com/casey/just), which is a simple command runner with less unnecessary cruft (for my use case as a command runner) and a much saner syntax, and I've been pretty happy with it so far, I hardly ever need to look up anything.

There's also task (https://taskfile.dev/), which is YAML-based and might work well in an environment where everything else is YAML anyway, and makesure (https://github.com/xonixx/makesure), which is pretty similar to just, but didn't really click with me.

Re:How did I run that code again? Tools to help recall by eirki on Friday January 28, 2022 @10:04AM (#30115468)
I also switched to just recently. Nice and simple syntax, and a very satisfying verb:

  just push
  just test
Re:How did I run that code again? Tools to help recall by theshrike79 on Friday January 28, 2022 @07:50AM (#30113923)
Regardless of the language I use for a project I always have these:

  - make test
  - make build (or run if it's an interactive app)
  - make publish
Publish runs test + build and uploads it to "production".

For Go projects I've started to move to Magefiles though: https://magefile.org

Re:How did I run that code again? Tools to help recall by sigmonsays on Friday January 28, 2022 @09:32AM (#30115042)
I dont get mage, but i've been using makefiles for over 13 years.

I love go but the only example on the site is bad, and there is not any others. Also, executing commands in go is tedious and verbose w/o helpers. The "Why" on the page fails to convince me as well.

How is a makefile too much whitespace?

Is there any good examples of mage being used in a larger project? preferably a popular one?

Re:How did I run that code again? Tools to help recall by theshrike79 on Friday January 28, 2022 @10:54AM (#30116204)
If your makefile is mostly just simple single commands, there really is no point in moving to magefiles.

The test/lint/build phases of my magefiles are mostly the same as makefiles. What differs is the publish command:

There I can make use of (for example)native AWS libraries to do complex deployment processes with error checking and validation. All this is of course doable with makefiles, but it gets very tedious compared to a "real" programming language.

Re:How did I run that code again? Tools to help recall by dgsb on Friday January 28, 2022 @08:22AM (#30114221)
mage is great, I'm moving forward to that too.
Re:How did I run that code again? Tools to help recall by silves89 on Friday January 28, 2022 @08:02AM (#30114022)
I grew frustrated with the compromises of makefiles for this and over the years I wrote a couple of alternatives, run_lib[1] and lk[2]. Now I write files full of the bash functions I need and use lk to explore and execute them. I.e. it's a consistent interface accross projects.

[1] https://github.com/jamescoleuk/lk

[2] https://github.com/jamescoleuk/run_lib

Re:How did I run that code again? Tools to help recall by dylanowen on Friday January 28, 2022 @07:45AM (#30113886)
Same here, I have a makefile in every project.