Post bard review.
This commit is contained in:
parent
bb84054fe7
commit
aa7043fd1c
|
|
@ -2,15 +2,14 @@
|
|||
title: "Quick Review of Just"
|
||||
author: "James Pace"
|
||||
date: "2024/01/10"
|
||||
draft: true
|
||||
---
|
||||
|
||||
[Just](https://just.systems/man/en/) is a command runner that operates kind of like make,
|
||||
if make was a command runner, not a build tool.
|
||||
[Just](https://just.systems/man/en/) is a command runner that operates kind of like make.
|
||||
|
||||
When you call `just <thing>`, just looks for a `Justfile` in a parent directory, and does
|
||||
whatever is under the `<thing>` entry in the file, where "things under" includes running a set
|
||||
of bash commands or running a script that can be written inline.
|
||||
Just lets you define tasks in a simple, human-readable file called a Justfile.
|
||||
To run a task, simply call `just <task_name>`. Just will automatically find the
|
||||
Justfile in the nearest parent directory and execute the commands defined for that
|
||||
task.
|
||||
|
||||
For example, given the `Justfile`:
|
||||
|
||||
|
|
@ -25,18 +24,15 @@ test:
|
|||
the command `just test` will call `cargo test --features log` in the current terminal window.
|
||||
|
||||
Compared to `make`, `just`:
|
||||
1. Doesn't require `.PHONY` targets for targets that don't produce any files.
|
||||
2. Can be called below the directory the `Justfile` is in, and still find the `Justfile`
|
||||
1. Eliminates the need for manual .PHONY target creation, saving you time and reducing
|
||||
clutter in Justfiles compared to Makefiles.
|
||||
2. Can be called below the directory the `Justfile` is in and still find the `Justfile`
|
||||
in the parent directory.
|
||||
|
||||
In my recent development where I was doing development calling wasm written in rust in a
|
||||
In my recent development where I was calling wasm written in rust in a
|
||||
web app, I found `just` particularly useful.
|
||||
Building the app took multiple commands, one command for compiling the rust part and
|
||||
a second command to bundle the JavaScript.
|
||||
Combining things under a single `just` target was nice.
|
||||
|
||||
I considered just using `make` for this application, but:
|
||||
|
||||
1. Having to add .PHONY targets adds line noise that adds up.
|
||||
2. I found being able to call `just` from any subdirectory really
|
||||
convenient.
|
||||
Combining things under a single `just` target was nice and lead to quicker
|
||||
iterations.
|
||||
Loading…
Reference in New Issue