Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix check info log #52

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/origin/checkUpdate.js
Original file line number Diff line number Diff line change
@@ -12,14 +12,14 @@ import { PackageName } from '#common/constants/question.const.js'
const { timestamp, hasShow } = (await getStore('checkResult')) ?? {}
if (Date.now() - timestamp <= Day || hasShow) process.exit(0)

const { localVersion, remoteVersion, isCliUpdate } = await checkUpdate()
const { localVersion, npmVersion, isCliUpdate } = await checkUpdate()
const needShow = false
if (isCliUpdate) {
const installInfo = [NpmInstall, YarnInstall, PnpmInstall]
.map((fun) => fun(PackageName, true, true)) // 暂时先默认为全局
.join('\n')
logger.warn(
`[leetcode-practice] 检测到新版本[ ${remoteVersion} ]已经发布! 您当前的版本为[ ${localVersion} ]! 您可以执行对应的指令进行手动更新~`
`[leetcode-practice] 检测到新版本[ ${npmVersion} ]已经发布! 您当前的版本为[ ${localVersion} ]! 您可以执行对应的指令进行手动更新~`
)
logger.info(`${installInfo}`)
}
Loading