Files
rustls/admin/pull-usage
Daniel McCarney 44bac99c6e fix: avoid hardcoded (ba)sh path in helper scripts.
Prior to this commit some helper scripts used hardcoded paths to
`/bin/sh` and `/bin/bash` in script shebangs. This will error on systems
that don't place `bash` in `/bin/` (e.g. NixOS).

This commit updates the scripts to use `/usr/bin/env` to find `bash`
based on the user's `$PATH`. This has better portability and allows the
scripts to run without err (or specifying an interpreter explicitly) on
systems with atypical `bash` installs.
2023-03-02 10:28:10 +01:00

18 lines
694 B
Bash
Executable File

#!/usr/bin/env sh
# Extract the example usage into README.md
set -e
awk 'BEGIN { take=1 }/```tlsclient-mio/{take=0;print}take' < README.md > README.md.new
./target/debug/tlsclient-mio --help >> README.md.new
awk '/^```tlsclient-mio$/ {start=1;} start' < README.md > README.md.tmp
awk '/^```$/ {start=1;} start' < README.md.tmp >> README.md.new
mv README.md.new README.md
awk 'BEGIN { take=1 }/```tlsserver-mio/{take=0;print}take' < README.md > README.md.new
./target/debug/tlsserver-mio --help >> README.md.new
awk '/^```tlsserver-mio$/ {start=1;} start' < README.md > README.md.tmp
awk '/^```$/ {start=1;} start' < README.md.tmp >> README.md.new
mv README.md.new README.md
rm README.md.tmp