feat(auto-update-checker): improve local dev version display
- Add getLocalDevPath() and getLocalDevVersion() functions - Improve getCachedVersion() with fallback to bundled package.json - Display correct version in startup toast for local dev mode 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin"
|
||||
import { checkForUpdate, getCachedVersion } from "./checker"
|
||||
import { checkForUpdate, getCachedVersion, getLocalDevVersion } from "./checker"
|
||||
import { invalidatePackage } from "./cache"
|
||||
import { PACKAGE_NAME } from "./constants"
|
||||
import { log } from "../../shared/logger"
|
||||
@@ -25,7 +25,8 @@ export function createAutoUpdateCheckerHook(ctx: PluginInput, options: AutoUpdat
|
||||
if (result.isLocalDev) {
|
||||
log("[auto-update-checker] Skipped: local development mode")
|
||||
if (showStartupToast) {
|
||||
await showVersionToast(ctx, getCachedVersion())
|
||||
const version = getLocalDevVersion(ctx.directory) ?? getCachedVersion()
|
||||
await showVersionToast(ctx, version)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user