Lines 1741-1781javascript
1742 const parse = (v) => v.split('.').map(Number);
1743 const curr = parse(currentVersion);
1744 const latest = parse(latestVersion);
1745 const isNewer = latest[0] > curr[0] || (latest[0] === curr[0] && latest[1] > curr[1]) || (latest[0] === curr[0] && latest[1] === curr[1] && latest[2] > curr[2]);
1748 console.log(chalk.green('\n✓ You are on a newer version than npm latest.'));
1752 console.log(chalk.yellow(`\n⬆ Update available: ${currentVersion} → ${latestVersion}`));
1754 if (options.check) {
1755 console.log(chalk.cyan('\nRun `flowmind update` to install.'));
1759 // Detect install method
1760 const isGlobal = (() => {
1762 const globalRoot = execSync('npm root -g', { encoding: 'utf-8' }).trim();
1763 const localPath = require.resolve('../package.json');
1764 return localPath.startsWith(globalRoot);
1765 } catch { return false; }
1768 const installCmd = isGlobal
1769 ? `npm install -g flowmind@${latestVersion}`
1770 : `npm install flowmind@${latestVersion}`;
HighRuntime Package Install
Package source invokes a package manager install command at runtime.
bin/flowmind.jsView on unpkg · L1761 1772 console.log(chalk.cyan(`\nInstalling: ${installCmd}`));
1773 const spinner = ora('Updating FlowMind...').start();
1776 execSync(installCmd, { encoding: 'utf-8', stdio: 'pipe' });
1777 spinner.succeed(`FlowMind updated to ${latestVersion}!`);
1779 console.log(chalk.green('\n✓ Update complete!'));
1780 console.log(chalk.gray(' Run `flowmind --version` to verify.'));
1781 } catch (installError) {