@runfile/cli 1.7.2 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -5
- package/bin/darwin-arm64/run +0 -0
- package/bin/darwin-x64/run +0 -0
- package/bin/linux-arm64/run +0 -0
- package/bin/linux-x64/run +0 -0
- package/bin/win32-arm64/run.exe +0 -0
- package/bin/win32-x64/run.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -678,9 +678,30 @@ end
|
|
|
678
678
|
|
|
679
679
|
### Stopping early
|
|
680
680
|
|
|
681
|
-
`exit()` ends the
|
|
682
|
-
|
|
683
|
-
|
|
681
|
+
`exit()` ends the target it is written in, with a status — 0 when none is given. Nothing inside that target
|
|
682
|
+
catches it: not a `?` fallback, not `.ignore-errors`, not a `retry`. A target may forgive a command that failed,
|
|
683
|
+
but being told to stop is not that. It is also how a helper finishes early:
|
|
684
|
+
|
|
685
|
+
```sh
|
|
686
|
+
# runfiles/_setup-build.run
|
|
687
|
+
# Prepare the toolchain; Linux needs nothing
|
|
688
|
+
|
|
689
|
+
if RUN.os == "linux"
|
|
690
|
+
print("no setup needed")
|
|
691
|
+
exit()
|
|
692
|
+
end
|
|
693
|
+
|
|
694
|
+
$ ./scripts/setup-toolchain.sh
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
To a target that ran it, the status is how it went — exactly what `$ run _setup-build` would make of it. After a
|
|
698
|
+
0, the `run _setup-build` line is done and the next line runs. Anything else fails that `run` line, like a
|
|
699
|
+
command that failed: `.ignore-errors` forgives it, `retry` has another go, `code_of` scores it, and if nothing
|
|
700
|
+
handles it, the whole run ends with that status.
|
|
701
|
+
|
|
702
|
+
`error("…")` fails with a message, the way a command fails, so a `?` falls back from it and `.ignore-errors`
|
|
703
|
+
forgives it. `confirm("…")` asks, and stops the whole run if the answer is no. Nothing catches that, not even a
|
|
704
|
+
target that ran this one.
|
|
684
705
|
|
|
685
706
|
`confirm` is a function rather than a property, so the question can depend on what is about to happen — and is
|
|
686
707
|
skipped by `-y`, in CI, and under `--dry-run`, where there is nothing to approve.
|
|
@@ -972,8 +993,9 @@ error: `setup` has never been run
|
|
|
972
993
|
run setup
|
|
973
994
|
```
|
|
974
995
|
|
|
975
|
-
|
|
976
|
-
|
|
996
|
+
Only a setup that succeeded counts: one that failed, or ended with a non-zero `exit()`, leaves the gate shut. It
|
|
997
|
+
re-triggers when `setup.run` itself changes, so a new dependency is not silently missed. `--dry-run` is exempt,
|
|
998
|
+
CI is exempt, and `RUNFILE_SKIP_PREPARE=1` bypasses it.
|
|
977
999
|
|
|
978
1000
|
The record lives in `state.json` in the platform state directory. In CI there is none: a runner is built and
|
|
979
1001
|
thrown away, so there is no earlier session whose `setup` this one could be relying on — the gate is not
|
package/bin/darwin-arm64/run
CHANGED
|
Binary file
|
package/bin/darwin-x64/run
CHANGED
|
Binary file
|
package/bin/linux-arm64/run
CHANGED
|
Binary file
|
package/bin/linux-x64/run
CHANGED
|
Binary file
|
package/bin/win32-arm64/run.exe
CHANGED
|
Binary file
|
package/bin/win32-x64/run.exe
CHANGED
|
Binary file
|
package/package.json
CHANGED