UNPKG

@basictech/cli

Version:

Basic CLI for creating & managing your projects

21 lines 742 B
import { getVersion } from '../lib/version.js'; import { ApiClient } from '../lib/api.js'; export async function VersionCommand() { const currentVersion = getVersion(); console.log(`basic v${currentVersion}`); try { const apiClient = ApiClient.getInstance(); const latestVersion = await apiClient.checkLatestRelease(); if (latestVersion !== currentVersion) { console.log(`\nUpdate available: ${currentVersion}${latestVersion}`); console.log('Run `basic update` to install it.'); } else { console.log('Up to date.'); } } catch { // Network unavailable — skip update check silently } } //# sourceMappingURL=version.js.map