chexiu-cli
Advanced tools
Comparing version 1.0.9 to 1.1.0
@@ -17,8 +17,17 @@ #!/usr/bin/env node | ||
const options = { | ||
templateName: 'vue', | ||
src: process.cwd() | ||
} | ||
program | ||
.command('create <pwd>') | ||
.option('--js', '使用js版本') | ||
.description('创建一个项目') | ||
.action((dir, command) => { | ||
if (command.js) { | ||
options.templateName = 'vue-js' | ||
} | ||
const Create = require('../scripts/create.js') | ||
const create = new Create(dir, process.cwd()).create() | ||
const create = new Create(dir, options).create() | ||
create | ||
@@ -40,9 +49,9 @@ .then(async () => { | ||
program | ||
.command('rm <dir>') | ||
.option('-r, --recursive', 'Remove recursively') | ||
.action(function (dir, cmdObj) { | ||
console.log('remove ' + dir + (cmdObj.recursive ? ' recursively' : '')) | ||
}) | ||
// program | ||
// .command('rm <dir>') | ||
// .option('-r, --recursive', 'Remove recursively') | ||
// .action(function (dir, cmdObj) { | ||
// console.log('remove ' + dir + (cmdObj.recursive ? ' recursively' : '')) | ||
// }) | ||
program.parse(process.argv) |
{ | ||
"name": "chexiu-cli", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "这是一个cli", | ||
@@ -5,0 +5,0 @@ "module": "esm", |
@@ -7,4 +7,5 @@ const fs = require('fs-extra') | ||
src = __dirname | ||
constructor(name, src) { | ||
console.log('name, path: ', name, src) | ||
templateName = 'vue' | ||
constructor(name, options) { | ||
const { templateName, src } = options | ||
this.name = name || this.name | ||
@@ -15,2 +16,3 @@ if (!src) { | ||
this.src = src | ||
this.templateName = templateName | ||
this.projectPath = path.resolve(this.src, this.name) | ||
@@ -34,3 +36,3 @@ } | ||
fs.copy(path.resolve(__dirname, '../templates/vue'), this.projectPath) | ||
fs.copy(path.resolve(__dirname, `../templates/${this.templateName}`), this.projectPath) | ||
.then(() => { | ||
@@ -37,0 +39,0 @@ resolve() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
76288
63
1088
2
8
3