diff --git a/build/generate-search-data.js b/build/generate-search-data.js index 1708edcef..a3d7fe824 100644 --- a/build/generate-search-data.js +++ b/build/generate-search-data.js @@ -35,5 +35,5 @@ glob('./docs/**/*.md', {}, function (er, docs) { path: doc.replace('.md', '') }); } - fs.writeFileSync('./public/docs/docs.json', JSON.stringify(resultData)); + fs.writeFileSync('./gh-pages/docs/docs.json', JSON.stringify(resultData)); }); diff --git a/deploy-gh-pages.sh b/deploy-gh-pages.sh index 10d0f92c4..b27330a5d 100755 --- a/deploy-gh-pages.sh +++ b/deploy-gh-pages.sh @@ -1,10 +1,10 @@ #!/bin/bash set -e -if [ -z "$(git status --porcelain)" ]; then +if [ -z "$(git status --porcelain)" ]; then # Working directory clean echo "Working directory clean" -else +else # Uncommitted changes read -p "You got uncommitted changes, press y to continue? " -n 1 -r echo # (optional) move to a new line @@ -21,6 +21,8 @@ fis3 release gh-pages -c node ./build/upload2cdn.js $1 +node ./build/generate-search-data.js + git add gh-pages -f git commit -m "更新 gh-pages" @@ -33,4 +35,4 @@ git commit -m 'rebuild pages' --allow-empty git push origin -echo "done" \ No newline at end of file +echo "done"