Skip to content

Commit 546481d

Browse files
committed
fix: autofill base again again again again again again again
1 parent 7d6766b commit 546481d

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@ jobs:
1414
- name: Checkout Branch
1515
uses: actions/checkout@v2
1616

17-
- name: Set Base Url
17+
- name: Inject Base Url
1818
run: |
1919
BRANCH=$(echo ${GITHUB_REF} | sed -e 's/refs\/heads\///')
20-
BEFORE='@base@'
21-
if [[ $BRANCH == ver/* ]]; then
22-
BRANCH_NAME=$(echo $BRANCH | sed 's|origin/||')
23-
AFTER=$(echo $BRANCH_NAME | sed 's|build/ver/||')
24-
else
25-
AFTER=''
20+
BRANCH_NAME=$(echo $BRANCH | sed 's|origin/||')
21+
if [[ $BRANCH_NAME == ver/* ]]; then
22+
VER=$(echo $BRANCH_NAME | sed 's|build/ver/||')
23+
echo sed -i "s/BASE_INJECT_POINT/${VER}/g" ./docs/.vitepress/config.mts > replace.sh
24+
chmod +x replace.sh
25+
./replace.sh
26+
rm replace.sh
2627
fi
27-
echo $AFTER
28-
sed -i "s/${BEFORE}/${AFTER}/g" ./docs/.vitepress/config.mts
2928
3029
- name: Setup Node.js
3130
uses: actions/setup-node@v2

docs/.vitepress/config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ const vitepressOptions: UserConfig = {
2727
description: "Docs of CommandAPI",
2828
cleanUrls: true,
2929
metaChunk: true,
30-
base: "@base@",
3130
ignoreDeadLinks: true, // TODO remove when all things are done
3231
rewrites: {
3332
'en/:rest*': ':rest*'
3433
},
34+
base: 'BASE_INJECT_POINT',
3535
vite: {
3636
optimizeDeps: {
3737
exclude: [

0 commit comments

Comments
 (0)