@jinboker/self-use
Advanced tools
Comparing version 0.0.4 to 0.0.5
{ | ||
"name": "@jinboker/self-use", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "some tools use by myself", | ||
@@ -26,3 +26,4 @@ "scripts": { | ||
"dependencies": { | ||
"commander": "^3.0.2" | ||
"commander": "^3.0.2", | ||
"inquirer": "^7.0.0" | ||
}, | ||
@@ -29,0 +30,0 @@ "devDependencies": { |
#!/usr/bin/env node | ||
import program from 'commander'; | ||
import { VERSION } from '../version'; | ||
const program = require('commander'); | ||
const inquirer = require('inquirer'); | ||
const { VERSION } = require('../version'); | ||
const { addAction } = require('./action'); | ||
program | ||
.version(VERSION, '-v, --version') | ||
.command('init <name>') | ||
.action(name => { | ||
console.log(name); | ||
.version(VERSION, '-v, --version'); | ||
console.log(process.cwd(), 'xxx'); | ||
// 添加内容 | ||
program | ||
.command('add [type]') | ||
.action(type => { | ||
console.log(type, process.argv, 'xxx'); | ||
if (type === undefined) { | ||
inquirer | ||
.prompt([ | ||
{ | ||
type: 'list', | ||
name: 'action', | ||
message: '请选择操作', | ||
choices: Object.keys(addAction), | ||
}, | ||
]) | ||
.then(({ action }) => { | ||
if (action in addAction) { | ||
console.log(`add ${action}`); | ||
} | ||
}); | ||
return; | ||
} | ||
if (type in addAction) { | ||
console.log(`add ${type}`); | ||
return; | ||
} | ||
throw Error('请输入正确的type'); | ||
}); | ||
program.parse(process.argv); |
@@ -9,5 +9,4 @@ // eslint-disable-next-line import/no-extraneous-dependencies | ||
console.log(file, VERSION, packageJsonPath, 'xxx'); | ||
file.set('version', VERSION); | ||
file.save(); |
@@ -1,1 +0,1 @@ | ||
module.exports.VERSION = '0.0.4'; | ||
module.exports.VERSION = '0.0.5'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3481
8
92
2
+ Addedinquirer@^7.0.0
+ Addedansi-escapes@4.3.2(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedchardet@0.7.0(transitive)
+ Addedcli-cursor@3.1.0(transitive)
+ Addedcli-width@3.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedexternal-editor@3.1.0(transitive)
+ Addedfigures@3.2.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinquirer@7.3.3(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addedmute-stream@0.0.8(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedrestore-cursor@3.1.0(transitive)
+ Addedrun-async@2.4.1(transitive)
+ Addedrxjs@6.6.7(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtmp@0.0.33(transitive)
+ Addedtslib@1.14.1(transitive)
+ Addedtype-fest@0.21.3(transitive)