Browse Source

fix(scripts): always regnerate help docs

Josh Habdas 1 year ago
parent
commit
90b0f21ed5
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74
2 changed files with 2 additions and 3 deletions
  1. 1
    2
      bin/help
  2. 1
    1
      bin/upgrade

+ 1
- 2
bin/help View File

@@ -1,5 +1,4 @@
1 1
 #!/bin/sh
2
-set -e
3 2
 
4 3
 CONFIG_FILE=config.toml
5 4
 CONTENT_DIR=`sed -n 's/contentDir[=:]"\([^"]*\)".*/\1/p' <<< "$(cat $CONFIG_FILE | tr -d ' ')"`
@@ -7,7 +6,7 @@ CONTENT_DIR=`sed -n 's/contentDir[=:]"\([^"]*\)".*/\1/p' <<< "$(cat $CONFIG_FILE
7 6
 
8 7
 echo "Updating help documentation ..."
9 8
 kill $(ps aux | awk '/[h]ugo.*1414/ {print $2}') 2>/dev/null
10
-rm "$CONTENT_DIR"/help/index.md 2>/dev/null
9
+[ -f "$CONTENT_DIR"/help/index.md ] && rm "$CONTENT_DIR"/help/index.md
11 10
 hugo new help/index.md --kind help 1>/dev/null
12 11
 echo "Restarting help server ..."
13 12
 hugo serve --buildExpired --disableLiveReload --port 1414 1>/dev/null &

+ 1
- 1
bin/upgrade View File

@@ -9,7 +9,7 @@ generate_help_docs () {
9 9
    echo "Generating help documentation ..."
10 10
    meta_path=themes/after-dark/data/npm
11 11
    mkdir -p "$meta_path" && echo "$LATEST_META" | tr '\r\n' ' ' > "$meta_path"/latest.json
12
-   rm "$CONTENT_DIR"/help/index.md 2>/dev/null
12
+   [ -f "$CONTENT_DIR"/help/index.md ] && rm "$CONTENT_DIR"/help/index.md
13 13
    hugo new help/index.md --kind help 1>/dev/null
14 14
 }
15 15
 

Loading…
Cancel
Save