Merge pull request #181 from spotify/freben/paths-cli

Set correct destination path for created plugins
This commit is contained in:
Fredrik Adelöw
2020-03-06 14:18:01 +01:00
committed by GitHub
+4 -9
View File
@@ -303,7 +303,9 @@ export const movePlugin = (
process.stdout.write(MARKER_SUCCESS);
} catch (e) {
process.stdout.write(MARKER_FAILURE);
throw new Error(`Failed to move plugin: ${e.message}`);
throw new Error(
`Failed to move plugin from ${tempDir} to ${destination}: ${e.message}`,
);
}
};
@@ -324,14 +326,7 @@ const createPlugin = async () => {
const cliPackage = resolvePath(__dirname, '..', '..');
const templateFolder = resolvePath(cliPackage, 'templates', 'default-plugin');
const tempDir = path.join(os.tmpdir(), answers.id);
const pluginDir = path.join(
rootDir,
'..',
'..',
'packages',
'plugins',
answers.id,
);
const pluginDir = path.join(rootDir, 'packages', 'plugins', answers.id);
console.log();
console.log(chalk.green('Creating the plugin...'));