Skip to content

Commit 1d613b2

Browse files
committed
fix: make split-branch build workflow executable
1 parent f3eb656 commit 1d613b2

6 files changed

Lines changed: 22 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ jobs:
4242
run: ./tools/import-content-branch.sh origin/content
4343

4444
- name: 安装 Anzhiyu 主题
45-
run: |
46-
# 只是克隆主题代码,不需要在这里 install
47-
git clone -b main https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu
45+
run: ./tools/prepare-anzhiyu-theme.sh
4846

4947
- name: 安装项目依赖
5048
run: |

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Write content in the dedicated `content` worktree:
1818
When you need the Markdown files inside the `master` worktree for a local build:
1919

2020
- Run `./tools/import-content-branch.sh content`
21+
- Run `./tools/prepare-anzhiyu-theme.sh`
22+
- Then run your usual Hexo command such as `yarn build`
2123

2224
If you intentionally edited imported content inside the `master` worktree and want to push it back into `content`:
2325

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"deploy": "hexo deploy",
1111
"server": "hexo server",
1212
"bangumi": "hexo bangumi -u",
13+
"theme:prepare": "./tools/prepare-anzhiyu-theme.sh",
1314
"lint": "hexo check"
1415
},
1516
"hexo": {

tools/export-content-branch.sh

100644100755
File mode changed.

tools/import-content-branch.sh

100644100755
File mode changed.

tools/prepare-anzhiyu-theme.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
repo_root=$(git rev-parse --show-toplevel)
6+
theme_dir="$repo_root/themes/anzhiyu"
7+
theme_repo="https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git"
8+
theme_branch="main"
9+
10+
if [[ -f "$theme_dir/_config.yml" ]]; then
11+
echo "Anzhiyu theme is already present."
12+
exit 0
13+
fi
14+
15+
rm -rf "$theme_dir"
16+
git clone -b "$theme_branch" "$theme_repo" "$theme_dir" >/dev/null
17+
18+
echo "Prepared Anzhiyu theme in '$theme_dir'."

0 commit comments

Comments
 (0)