-
Notifications
You must be signed in to change notification settings - Fork 14
/
docs.sh
executable file
·33 lines (29 loc) · 1.5 KB
/
docs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
cd core
forge doc
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS (Darwin) sed command
find docs -type f -name '*.md' -print0 | xargs -0 sed -i.bak -E 's|github.com\/aloelabs\/aloe-ii\/blob\/([0-9a-fA-F]+)\/|github.com/aloelabs/aloe-ii/blob/\1/core/|g'
find docs -type f -name '*.md' -print0 | xargs -0 sed -i.bak -E 's|\/src\/(.*)\.md|/core/\1.md|g'
else
# Linux (including Ubuntu) sed command
find docs -type f -name '*.md' -print0 | xargs -0 sed -i -E 's|github.com\/aloelabs\/aloe-ii\/blob\/([0-9a-fA-F]+)\/|github.com/aloelabs/aloe-ii/blob/\1/core/|g'
find docs -type f -name '*.md' -print0 | xargs -0 sed -i -E 's|\/src\/(.*)\.md|/core/\1.md|g'
fi
cd ..
cp -rf core/docs/src/src/. docs/src/core
rm -rf core/docs
cd periphery
forge doc
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS (Darwin) sed command
find docs -type f -name '*.md' -print0 | xargs -0 sed -i.bak -E 's|github.com\/aloelabs\/aloe-ii\/blob\/([0-9a-fA-F]+)\/|github.com/aloelabs/aloe-ii/blob/\1/periphery/|g'
find docs -type f -name '*.md' -print0 | xargs -0 sed -i.bak -E 's|\/src\/(.*)\.md|/periphery/\1.md|g'
else
# Linux (including Ubuntu) sed command
find docs -type f -name '*.md' -print0 | xargs -0 sed -i -E 's|github.com\/aloelabs\/aloe-ii\/blob\/([0-9a-fA-F]+)\/|github.com/aloelabs/aloe-ii/blob/\1/periphery/|g'
find docs -type f -name '*.md' -print0 | xargs -0 sed -i -E 's|\/src\/(.*)\.md|/periphery/\1.md|g'
fi
cd ..
cp -rf periphery/docs/src/src/. docs/src/periphery
rm -rf periphery/docs