Skip to content

Commit

Permalink
Merge pull request #1202 from nickcdon/main
Browse files Browse the repository at this point in the history
🐛 修复doc文档开发、构建
  • Loading branch information
freyaLo authored Dec 20, 2024
2 parents 3e0df67 + 3982b0b commit 1820d93
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
uses: actions/checkout@v3

# 下载二进制文件
- name: Download Binary Files
run: |
set -ex
pwd
bash ./scripts/base/install_bin.sh
# - name: Download Binary Files
# run: |
# set -ex
# pwd
# bash ./scripts/base/install_bin.sh

- name: Setup Node 16
uses: actions/setup-node@v3
Expand Down
4 changes: 3 additions & 1 deletion doc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
.temp
.cache
dist
dist
tca_lib*
images
4 changes: 2 additions & 2 deletions doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"type": "module",
"license": "MIT",
"scripts": {
"dev": "vuepress dev",
"dev": "bash ./sync_images.sh & vuepress dev",
"build:comment": "echo '构建帮助文档,默认base前缀为document,可根据部署需要进行相应调整'",
"build": "BASE=${BASE:-CodeAnalysis} vuepress build -d ./dist"
"build": "bash ./sync_images.sh & BASE=${BASE:-CodeAnalysis} vuepress build -d ./dist"
},
"devDependencies": {
"@vuepress/plugin-search": "2.0.0-beta.63",
Expand Down
19 changes: 19 additions & 0 deletions doc/sync_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

url=${LIB_GITHUB_URL:-"https://github.com/TCATools/tca_lib/releases/download/v20241015.1/tca_lib-v1.8.zip"}

filename=$(basename "$url")
dirname=${filename%.*}

lib_image_path="${dirname}/tca_lib/doc/images"
image_path="images"

if [[ ! -d $image_path ]]; then
if [[ ! -d $lib_image_path ]]; then
if [[ ! -f $filename ]]; then
wget $url
fi
unzip $filename -d $dirname
fi
cp -r $lib_image_path $image_path
fi

0 comments on commit 1820d93

Please sign in to comment.