Skip to content

Commit

Permalink
fix spawn bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lcxfs1991 committed Jun 1, 2018
1 parent 6708ad6 commit df988f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 3.0.0-beta.9
## 3.0.0-beta.10
- 添加脚手架生命周期
- 修复更新项目脚手架的bug

Expand Down
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class KitPlugin extends SteamerPlugin {
this.kitOptions = this.getKitOptions();
this.ignoreFiles = [".git", ".svn"];

this.spawn = spawn;
this.git = git;
}

Expand Down Expand Up @@ -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
});
}
Expand Down Expand Up @@ -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()
});
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -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
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit df988f0

Please sign in to comment.