diff --git a/append_doc_feature.sh b/append_doc_feature.sh index 337885b..9129336 100755 --- a/append_doc_feature.sh +++ b/append_doc_feature.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail for var in "$@" do diff --git a/append_info.sh b/append_info.sh index 4bcad02..16048ee 100755 --- a/append_info.sh +++ b/append_info.sh @@ -1,6 +1,4 @@ -#!/bin/bash - -set -e +#!/usr/bin/env -S bash -euo pipefail for var in "$@" do @@ -19,4 +17,4 @@ do # Find the first free line after "//!" comments and insert the text there sed "0,/^[[:space:]]*$/ s/^[[:space:]]*$/$TEXT\n/" $var -i fi -done \ No newline at end of file +done diff --git a/build_relm_docs.sh b/build_relm_docs.sh index 4242b58..740715a 100755 --- a/build_relm_docs.sh +++ b/build_relm_docs.sh @@ -1,17 +1,10 @@ -#!/bin/sh +#!/usr/bin/env -S bash -euo pipefail -# Return on error -set -e +mkdir --parents docs/{stable,next} tmp +pushd tmp -mkdir docs -mkdir docs/stable -mkdir docs/next - -mkdir tmp -cd tmp - -git clone https://github.com/AaronErhardt/relm4 ./ -git checkout stable +git clone --depth 1 --no-single-branch -- https://github.com/Relm4/Relm4 ./ +git switch --detach $(git tag --list --sort "v:refname" | grep -v - | tail -n 1) # Stable docs export STABLE=1 @@ -20,26 +13,27 @@ find -name "lib.rs" -exec ../append_doc_feature.sh {} + cargo update -cd relm4-components +pushd relm4-components cargo +nightly doc --all-features -Z rustdoc-scrape-examples +popd -cd ../relm4-macros +pushd relm4-macros cargo +nightly doc --all-features # -Z rustdoc-scrape-examples +popd -cd .. cargo +nightly doc --all-features -Z rustdoc-scrape-examples -cd .. +popd mv tmp/target/doc/* docs/stable # Unstable docs export STABLE=0 -cd tmp +pushd tmp git stash -git checkout main +git switch main cargo clean --doc cargo update @@ -50,7 +44,7 @@ export RUSTDOCFLAGS="--cfg dox" cargo +nightly doc --all-features -Z rustdoc-scrape-examples -cd .. +popd mv tmp/target/doc/* docs/next diff --git a/fix_ssh.sh b/fix_ssh.sh index 83bb1e4..9ae3de3 100755 --- a/fix_ssh.sh +++ b/fix_ssh.sh @@ -1,7 +1,4 @@ -#!/bin/bash - -# Return on error -set -e +#!/usr/bin/env -S bash -euo pipefail # Overwrite global SSH configuration echo "Host *