Skip to content

Commit 40f656d

Browse files
committed
feat: support linux
1 parent 00c024c commit 40f656d

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

deploy/convert_to_index.sh

+18-7
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,21 @@ find . -type f -name "*.html" ! -name "index.html" | while read file; do
2121
move_html_to_index "$file"
2222
done
2323

24-
find . -type f -name "index.html" | while read file; do
25-
sed -i '' 's/\/index\.html/\//g' "$file"
26-
sed -i '' 's/index\.html/\//g' "$file"
27-
sed -i '' 's/\.html/\//g' "$file"
28-
sed -i '' 's/"\.\.\//"..\/..\//g' "$file"
29-
sed -i '' 's/"\.\//"..\//g' "$file"
30-
done
24+
25+
if [[ "$OSTYPE" == "darwin"* ]]; then
26+
find . -type f -name "index.html" | while read file; do
27+
sed -i '' 's/\/index\.html/\//g' "$file"
28+
sed -i '' 's/index\.html/\//g' "$file"
29+
sed -i '' 's/\.html/\//g' "$file"
30+
sed -i '' 's/"\.\.\//"..\/..\//g' "$file"
31+
sed -i '' 's/"\.\//"..\//g' "$file"
32+
done
33+
else
34+
find . -type f -name "index.html" | while read file; do
35+
sed -i 's/\/index\.html/\//g' "$file"
36+
sed -i 's/index\.html/\//g' "$file"
37+
sed -i 's/\.html/\//g' "$file"
38+
sed -i 's/"\.\.\//"..\/..\//g' "$file"
39+
sed -i 's/"\.\//"..\//g' "$file"
40+
done
41+
fi

deploy/roles/build/tasks/main.yml

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
- name: Install Mdbook
2-
ansible.builtin.unarchive:
3-
src: "https://github.com/rust-lang/mdBook/releases/download/v0.4.43/mdbook-v0.4.43-x86_64-unknown-linux-gnu.tar.gz"
4-
dest: "/tmp"
5-
remote_src: true
6-
7-
81
- name: Build The Book
92
ansible.builtin.command:
103
cmd: mdbook build

0 commit comments

Comments
 (0)