Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion modules/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { logTask, logError } from './LogUtils'
import init from './init'
import build from './build'
import start from './start'
import version from './version'

const action = process.argv[2]

Expand All @@ -11,7 +12,13 @@ const actions = {
init
}

if (actions[action]) {
const helperActions = {
'--version': version
}

if (helperActions[action]) {
helperActions[action]()
} else if (actions[action]) {
logTask(`[${action}]`, 'task')
actions[action](() => {
logTask(`[${action}]`, 'task complete')
Expand Down
7 changes: 7 additions & 0 deletions modules/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { log } from './LogUtils'
import { getPackageJSON } from './PackageUtils'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the app's package.json, not the libraries :\


export default function version() {
const pkg = getPackageJSON()
log(pkg.version)
}