-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
842404c
commit 196b21b
Showing
3 changed files
with
23 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
#! /usr/bin/env node | ||
|
||
const program = require('commander') | ||
const latestVersion = require('latest-version') | ||
const chalk = require('chalk') | ||
const {getPkgVersion, getPkgItemByKey} = require('../src/util') | ||
|
||
const { | ||
getPkgVersion | ||
} = require('../src/util') | ||
|
||
program | ||
.version(getPkgVersion()) | ||
.usage('<command> [options]') | ||
.command('init [projectName]', 'Init a project with default templete') | ||
.command('build', 'Build a project with options') | ||
.command('update', 'Update packages of taro') | ||
.parse(process.argv) | ||
const pkgName = getPkgItemByKey('name') | ||
const currentVersion = getPkgVersion() | ||
|
||
latestVersion(pkgName).then((latestVersion) => { | ||
console.log( | ||
`Current : ${chalk.yellow('v' + | ||
currentVersion)} Latest : ${chalk.green('v' + | ||
latestVersion)}`) | ||
|
||
console.log( | ||
`Run ${chalk.green('taro update')} update to the latest version`) | ||
program | ||
.version(getPkgVersion()) | ||
.usage('<command> [options]') | ||
.command('init [projectName]', 'Init a project with default templete') | ||
.command('build', 'Build a project with options') | ||
.command('update', 'Update packages of taro') | ||
.parse(process.argv) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters