diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fc852a..5fa6f1c 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 3.0.0-beta.9 +## 3.0.0-beta.10 - 添加脚手架生命周期 - 修复更新项目脚手架的bug diff --git a/index.js b/index.js index cef10a0..752ee7d 100755 --- a/index.js +++ b/index.js @@ -48,6 +48,7 @@ class KitPlugin extends SteamerPlugin { this.kitOptions = this.getKitOptions(); this.ignoreFiles = [".git", ".svn"]; + this.spawn = spawn; this.git = git; } @@ -228,8 +229,8 @@ class KitPlugin extends SteamerPlugin { ); if (!isGitFolderExists) { - spawn.sync("git", ["init"], { cwd: localPath }); - spawn.sync("git", ["remote", "add", "origin", repo], { + this.spawn.sync("git", ["init"], { cwd: localPath }); + this.spawn.sync("git", ["remote", "add", "origin", repo], { cwd: localPath }); } @@ -352,7 +353,7 @@ class KitPlugin extends SteamerPlugin { kitConfig.beforeUpdateDep.bind(this)(); } - spawn.sync(this.config.NPM, ["install"], { + this.spawn.sync(this.config.NPM, ["install"], { stdio: "inherit", cwd: process.cwd() }); @@ -606,7 +607,7 @@ class KitPlugin extends SteamerPlugin { type: "input", name: "npm", message: "type your npm command(npm|tnpm|cnpm etc): ", - default: "yarn" + default: "npm" } ]) .then(answers => { @@ -1120,7 +1121,7 @@ class KitPlugin extends SteamerPlugin { } // 安装项目node_modules包 - spawn.sync(this.config.NPM, ["install"], { + this.spawn.sync(this.config.NPM, ["install"], { stdio: "inherit", cwd: folderPath }); diff --git a/package.json b/package.json index dff744f..0ec0d4b 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "steamer-plugin-kit", - "version": "3.0.0-beta.9", + "version": "3.0.0-beta.10", "description": "steamer-plugin-kit", "main": "index.js", "bin": "index.js",