Skip to content

Commit bd7aed3

Browse files
bepnmelehan
authored andcommitted
Add a simple script to simplify editing of theme
1 parent 47a01b4 commit bd7aed3

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

edit-mod.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
what=$1
4+
done=false
5+
file="go.mod"
6+
7+
function trimGoMod {
8+
sed -i '' -e '$ d' $file;
9+
}
10+
11+
if test "$#" -ge 2; then
12+
done=true
13+
fi
14+
15+
if [[ $what == "theme" ]]; then
16+
line='replace github.com/bep/linodedocs => ../linodedocs'
17+
if $done; then
18+
trimGoMod
19+
else
20+
echo $line >> $file
21+
hugo server --ignoreVendorPaths "github.com/bep/**"
22+
fi
23+
fi
24+

go.mod

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ require (
99
github.com/bep/linodedocs v0.0.0-20200911084526-695f379cfe6b
1010
github.com/linode/linode-api-docs v4.73.0+incompatible // indirect
1111
)
12+
13+
14+
15+

0 commit comments

Comments
 (0)