mirror of
https://github.com/rustls/rustls.git
synced 2026-10-29 02:07:14 +08:00
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.
13 lines
564 B
Bash
Executable File
13 lines
564 B
Bash
Executable File
#!/usr/bin/env sh
|
|
# Extract the introductory documentation into the README.md
|
|
|
|
set -e
|
|
|
|
awk 'BEGIN { take=1 }/# Approach/{take=0;print}take' < README.md > README.md.new
|
|
grep '^//!' rustls/src/lib.rs | \
|
|
sed -e 's@^\/\/\! *@@g' | \
|
|
sed -e 's@manual](manual)@manual](https://docs.rs/rustls/latest/rustls/manual/_02_tls_vulnerabilities/index.html)@' | \
|
|
awk '/# Rustls - a modern TLS library/{take=1;next}/## Design Overview/{take=0}take' >> README.md.new
|
|
awk '/# Example code/{take=1}take' < README.md >> README.md.new
|
|
mv README.md.new README.md
|