From 3982b0b63345ea6b764d754268e85fa5ab07ff27 Mon Sep 17 00:00:00 2001 From: nickcdon Date: Fri, 20 Dec 2024 17:53:09 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8Ddoc=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E3=80=81=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docs.yml | 10 +++++----- doc/.gitignore | 4 +++- doc/package.json | 4 ++-- doc/sync_images.sh | 19 +++++++++++++++++++ 4 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 doc/sync_images.sh diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a060d46f5..4653a63c1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 diff --git a/doc/.gitignore b/doc/.gitignore index 7c14f3874..84d9deb42 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,4 +1,6 @@ node_modules .temp .cache -dist \ No newline at end of file +dist +tca_lib* +images diff --git a/doc/package.json b/doc/package.json index f653ea4d3..12470dfaa 100644 --- a/doc/package.json +++ b/doc/package.json @@ -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", diff --git a/doc/sync_images.sh b/doc/sync_images.sh new file mode 100644 index 000000000..b868bc890 --- /dev/null +++ b/doc/sync_images.sh @@ -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