Adds an `unindent()` function that strips common leading indentation
from strings, and apply it to integration test case strings, so that they
can be written in a more readable style.
This commit changes the integration tests to run with bash
as the shell, instead of bash, dash, and the system's sh.
Running the integration tests with multiple shells has never
revealed a bug in Just, and they make the tests take longer,
so let's get rid of them.
Previously, warnings upon encountering a deprecated use `=` in
assignments, exports, and aliases would print a message without any
indication of where the offending `=` was. This diff adds a proper
`Warning` enum, and uses it to report context, as is done with
compilation and runtime errors.
Given the following justfile:
alias b := build
build:
echo 'Building!'
Just will show the alias along with the recipe:
$ just --show b
alias b := build
build:
echo 'Building!'
Just's dependency on brev was the cause of a
fairly deep branch of the transitive dependency
tree. To decrease build time and make the life of
packagers easier, this diff moves the functionality
that Just was using in Brev into Just itself, and
removes the dependency on Brev.
Fortunately, the only functionality that Just was
using was the output function and OutputError
enum, so this was easily done.
Integration tests run with bash, dash, and whatever's installed as `sh`, to ensure compatibility with a wide range of systems.
This commit changed the way that dash escapes special characters, which broke the integration tests:
https://git.kernel.org/pub/scm/utils/dash/dash.git/commit/?id=6900ff60ef7347a8c1445853a8f4689808e0976e
This commit modifies our tests to be compatible with dash before and after the changes, and should fix the Travis build.
The invalid escape sequence error message is delimited with backticks
and isn't used as input to other programs. This diff tweaks the escaping rules
slightly when printing invalid escape sequences. In particular, `, \, ',
and " are now not be escaped.
`env_var(key)` looks up the value of the environment variable with name `key`, aborting execution if it is not found.
`env_var_or_default(key, default)` looks up the value of the environment variable with name `key`, returning `default` if it is not found.