Skip to content

Commit

Permalink
fix: fixed save path
Browse files Browse the repository at this point in the history
  • Loading branch information
whatsaaaa committed Apr 8, 2021
1 parent 84e8fce commit 54a7419
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ async function getName() {
}

function createPluginProject(options) {
const pwd = shelljs.pwd()
const savePath = pwd.stdout;
const savePath = process.env.INIT_CWD;
console.log(`✨ Creating project in ${chalk.yellow(savePath + "/" + options.npmName)}`);
console.log(`🚀 Invoking generator...`);
const vars = {
Expand Down Expand Up @@ -126,7 +125,7 @@ function createPluginProject(options) {
]);

destPath = path.join.apply(null, [
options.npmName,
savePath + "/" + options.npmName,
...destPath.split("/")
]);

Expand All @@ -135,6 +134,7 @@ function createPluginProject(options) {
});

// Change current dir
process.chdir(savePath);
process.chdir(`./${vars.npmName}`);

console.log(`🗃 Initializing git repository...`);
Expand Down

0 comments on commit 54a7419

Please sign in to comment.