Skip to content

Commit

Permalink
更新配置
Browse files Browse the repository at this point in the history
  • Loading branch information
onresize committed Jun 13, 2024
1 parent 08d5189 commit 3b174f1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function getArgs() {
const { repo } = getArgs()

process.env.repo = repo
console.repo = repo

const childProcess = spawn('npm', ['run', 'build'], { stdio: 'inherit' })
// 监听子进程的 'close' 事件
Expand Down
2 changes: 0 additions & 2 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ const tags = ['程序员', '编程', '前端']
const isProd = process.env.NODE_ENV === 'production'
const repo = process.env?.repo

console.log('仓库:', repo)

function reWriteLog() {
console.log = (function (log) {
return isProd ? function () {} : log
Expand Down
3 changes: 2 additions & 1 deletion docs/.vuepress/layouts/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ watch(
}
)
const repo = console?.repo || void 0
onMounted(() => {
loadScript(
process.env?.repo === 'github'
repo === 'github'
? '/web-blogs/static/js/auto-upgrade.js'
: '/static/js/auto-upgrade.js'
)
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/public/static/js/auto-upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
s.type = 'text/javascript'
s.id = 'version-polling'
s.src =
process.env?.repo === 'github'
console.repo === 'github'
? '/web-blogs/static/js/version-polling.js'
: '/static/js/version-polling.js'

Expand Down

0 comments on commit 3b174f1

Please sign in to comment.