-
Notifications
You must be signed in to change notification settings - Fork 5
/
release.sh
executable file
·21 lines (14 loc) · 974 Bytes
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Run the readmegenscript
SRC=~/Documents/digital-datasheets
DST=~/Documents/edatasheets.github.io
# TODO: copy README too
cp -r "$SRC/part-spec" "$SRC/support-docs" "$SRC/examples" "$SRC/LICENSE" "$DST"
mv "$DST/support-docs/README.md" "$DST"
rm -r "$DST/support-docs"
# Rename the source information in the README with the official release github URI
sed -i 's|https:/github.com/edatasheets/digital-datasheets/blob/main/part-spec/|https://github.com/edatasheets/edatasheets.github.io/blob/main/part-spec/|g' "$DST/README.md"
sed -i 's|https://github.com/edatasheets/digital-datasheets/blob/main/part-spec/|https://github.com/edatasheets/edatasheets.github.io/blob/main/part-spec/|g' "$DST/README.md"
# Replace the $id line with the official release github URI in every JSON file in part-spec.
cd "$DST"
sed -i 's|"$id":.*\(/part-spec/.*\)$|"$id": "https://github.com/edatasheets/edatasheets.github.io/blob/main\1|' $(find "part-spec/" | grep '\.json$')