Skip to content

Commit 4ff622e

Browse files
authored
Merge pull request #12 from Relm4/improve_scripts
Improve and fix scripts
2 parents 164c7f0 + 9bd15cc commit 4ff622e

4 files changed

Lines changed: 17 additions & 28 deletions

File tree

append_doc_feature.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env -S bash -euo pipefail
22

33
for var in "$@"
44
do

append_info.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#!/bin/bash
2-
3-
set -e
1+
#!/usr/bin/env -S bash -euo pipefail
42

53
for var in "$@"
64
do
@@ -19,4 +17,4 @@ do
1917
# Find the first free line after "//!" comments and insert the text there
2018
sed "0,/^[[:space:]]*$/ s/^[[:space:]]*$/$TEXT\n/" $var -i
2119
fi
22-
done
20+
done

build_relm_docs.sh

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
#!/bin/sh
1+
#!/usr/bin/env -S bash -euo pipefail
22

3-
# Return on error
4-
set -e
3+
mkdir --parents docs/{stable,next} tmp
4+
pushd tmp
55

6-
mkdir docs
7-
mkdir docs/stable
8-
mkdir docs/next
9-
10-
mkdir tmp
11-
cd tmp
12-
13-
git clone https://github.com/AaronErhardt/relm4 ./
14-
git checkout stable
6+
git clone --depth 1 --no-single-branch -- https://github.com/Relm4/Relm4 ./
7+
git switch --detach $(git tag --list --sort "v:refname" | grep -v - | tail -n 1)
158

169
# Stable docs
1710
export STABLE=1
@@ -20,26 +13,27 @@ find -name "lib.rs" -exec ../append_doc_feature.sh {} +
2013

2114
cargo update
2215

23-
cd relm4-components
16+
pushd relm4-components
2417
cargo +nightly doc --all-features -Z rustdoc-scrape-examples
18+
popd
2519

26-
cd ../relm4-macros
20+
pushd relm4-macros
2721
cargo +nightly doc --all-features
2822
# -Z rustdoc-scrape-examples
23+
popd
2924

30-
cd ..
3125
cargo +nightly doc --all-features -Z rustdoc-scrape-examples
3226

33-
cd ..
27+
popd
3428

3529
mv tmp/target/doc/* docs/stable
3630

3731
# Unstable docs
3832
export STABLE=0
39-
cd tmp
33+
pushd tmp
4034

4135
git stash
42-
git checkout main
36+
git switch main
4337

4438
cargo clean --doc
4539
cargo update
@@ -50,7 +44,7 @@ export RUSTDOCFLAGS="--cfg dox"
5044

5145
cargo +nightly doc --all-features -Z rustdoc-scrape-examples
5246

53-
cd ..
47+
popd
5448

5549
mv tmp/target/doc/* docs/next
5650

fix_ssh.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#!/bin/bash
2-
3-
# Return on error
4-
set -e
1+
#!/usr/bin/env -S bash -euo pipefail
52

63
# Overwrite global SSH configuration
74
echo "Host *

0 commit comments

Comments
 (0)