-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
3 changed files
with
49 additions
and
1 deletion.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import os from 'os' | ||
import child_process from 'child_process' | ||
import format from 'chalk' | ||
|
||
import logger from '../utils/debug' | ||
import { p, echo, echon } from '../utils/print-tools' | ||
import pjson from '../../package.json' | ||
|
||
const { debug } = logger('cmd-sysinfo') | ||
|
||
export default class SysInfoCmd { | ||
constructor (context) { | ||
debug('SysInfoCmd.constructor') | ||
this.context = context | ||
this.session = context.session | ||
} | ||
|
||
async run ([cmd]) { | ||
const npmVersion = child_process.spawnSync('npm', ['-v']) | ||
.stdout | ||
.toString() | ||
.trim() | ||
|
||
echo() | ||
echon(2)(` ${format.dim('cli version')}:`) | ||
echo(` ${format.cyan(pjson.version)}`) | ||
echon(2)(`${format.dim('node version')}:`) | ||
echo(` ${format.cyan(process.version)}`) | ||
echon(2)(` ${format.dim('npm version')}:`) | ||
echo(` ${format.cyan(npmVersion)}`) | ||
echon(2)(` ${format.dim('platform')}:`) | ||
echo(` ${format.cyan(os.type)}`) | ||
echon(2)(` ${format.dim('arch')}:`) | ||
echo(` ${format.cyan(process.arch)}`) | ||
echo() | ||
} | ||
} |