mirror of
https://github.com/sharkdp/fd.git
synced 2026-08-29 02:32:00 +08:00
Add a little more automation for the release
Add an awk script for automatically updating the help text in README.md
This commit is contained in:
Vendored
+4
-1
@@ -5,6 +5,9 @@ necessary changes for the upcoming release.
|
||||
|
||||
## Version bump
|
||||
|
||||
This section can be done by running `scripts/version-bump.sh` with the new version
|
||||
as an argument.
|
||||
|
||||
- [ ] Create a new branch for the required changes for this release.
|
||||
- [ ] Update version in `Cargo.toml`. Run `cargo build` to update `Cargo.lock`.
|
||||
Make sure to `git add` the `Cargo.lock` changes as well.
|
||||
@@ -21,7 +24,7 @@ necessary changes for the upcoming release.
|
||||
new version).
|
||||
- [ ] Review `-h`, `--help`, and the `man` page.
|
||||
- [ ] Run `fd -h` and copy the output to the *"Command-line options"* section in
|
||||
the README
|
||||
the README. This can be done by running `gawk -i inplace -f scripts/update-help.awk README.md`.
|
||||
- [ ] Push all changes and wait for CI to succeed (before continuing with the
|
||||
next section).
|
||||
- [ ] Optional: manually test the new features and command-line options described
|
||||
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/gawk -f
|
||||
|
||||
BEGIN {
|
||||
inSection = 0
|
||||
inBlock = 0
|
||||
}
|
||||
|
||||
|
||||
/Command-line options/ { inSection=1 }
|
||||
|
||||
inSection && /^```/ {
|
||||
inBlock=1
|
||||
inSection=0
|
||||
# print the starting fence then move to next line
|
||||
print
|
||||
next
|
||||
}
|
||||
|
||||
inBlock && /^```/ {
|
||||
cmd="cargo run --release --quiet -- -h"
|
||||
# Output the results of fd -h
|
||||
u=0
|
||||
while (cmd | getline line) {
|
||||
# Skip everything before the usage line
|
||||
if (line ~ /^Usage/) {
|
||||
u=1;
|
||||
}
|
||||
if (u) {
|
||||
print line
|
||||
}
|
||||
}
|
||||
status = close(cmd)
|
||||
if (status) {
|
||||
print "failed to generate help output" > "/dev/stderr"
|
||||
exit 1
|
||||
}
|
||||
inBlock = 0
|
||||
}
|
||||
|
||||
!inBlock
|
||||
|
||||
Reference in New Issue
Block a user