diff --git a/.changeset/poor-fireants-warn.md b/.changeset/poor-fireants-warn.md new file mode 100644 index 000000000..f300335c0 --- /dev/null +++ b/.changeset/poor-fireants-warn.md @@ -0,0 +1,5 @@ +--- +"@latitude-data/cli": minor +--- + +Add also to latitude version installed version of the app diff --git a/packages/cli/src/commands/version/index.ts b/packages/cli/src/commands/version/index.ts index 669063c60..7a0cc4514 100644 --- a/packages/cli/src/commands/version/index.ts +++ b/packages/cli/src/commands/version/index.ts @@ -2,6 +2,8 @@ import colors from 'picocolors' import setRootDir from '$src/lib/decorators/setRootDir' import boxedMessage from '$src/lib/boxedMessage' import findOrCreateConfigFile from '$src/lib/latitudeConfig/findOrCreate' +import { getInstalledVersion } from '$src/lib/getAppVersions' +import config from '$src/config' function versionLine({ name, version }: { name: string; version: string }) { return `${colors.blue(`${name} version: `)} ${colors.green(version)}` @@ -9,6 +11,7 @@ function versionLine({ name, version }: { name: string; version: string }) { async function showVersions() { const latitudeJson = await findOrCreateConfigFile() const appVersion = latitudeJson.data.version + const installed = getInstalledVersion(config.rootDir) boxedMessage({ color: 'green', title: 'Latitude versions', @@ -17,7 +20,17 @@ async function showVersions() { name: 'CLI', version: process.env.PACKAGE_VERSION ?? 'development', })} - ${versionLine({ name: 'App', version: appVersion! })} + ${versionLine({ name: 'App (latitude.json)', version: appVersion! })} + ${ + installed + ? versionLine({ name: 'App (installed)', version: installed }) + : '\n' + } + ${ + !installed + ? colors.red("App is not installed run 'latitude setup'") + : '' + } `, }) }