UNPKG

smartui-migration-tool

Version:

Enterprise-grade CLI tool for migrating visual testing platforms to LambdaTest SmartUI

36 lines (27 loc) • 1.27 kB
const { Command } = require('@oclif/core'); const chalk = require('chalk'); const { execSync } = require('child_process'); const { ASCIILogos } = require('../utils/ascii-logos'); class Version extends Command { static description = 'Show version information'; async run() { console.log(ASCIILogos.getMinimalLogo()); const packageJson = require('../package.json'); const installedVersion = packageJson.version; console.log(chalk.cyan.bold(`\nšŸ“¦ Installed Version: ${installedVersion}`)); try { // Check for latest version on npm const latestVersion = execSync('npm view smartui-migration-tool version', { encoding: 'utf8' }).trim(); if (latestVersion !== installedVersion) { console.log(chalk.yellow(`šŸ”„ Latest Version: ${latestVersion}`)); console.log(chalk.gray('šŸ’” Run "smartui-migrator update" to update to the latest version')); } else { console.log(chalk.green('āœ… You have the latest version!')); } } catch (error) { console.log(chalk.gray('ā„¹ļø Could not check for updates')); } console.log(chalk.gray('\nFor more information, visit: https://github.com/RushilK7/smartui-migration-tool')); } } module.exports.default = Version;