Skip to content

Commit

Permalink
Add plugin option to package generator
Browse files Browse the repository at this point in the history
  • Loading branch information
lorisleiva committed Jun 16, 2023
1 parent 4342375 commit abb3011
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion configs/generate-new-package.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import chalk from 'chalk';
const __dirname = dirname(fileURLToPath(import.meta.url));
const templateFolder = __dirname + '/new-package-template';
const packageName = process.argv[2];
const isPlugin = process.argv[3] && (process.argv[3] === '--plugin' || process.argv[3] === '-p');

if (!packageName) {
error('Please provide a package name as an argument.');
}

const packageFolder = __dirname + '/../packages/' + packageName;
const packageFolder = __dirname + `/../${isPlugin ? 'plugins' : 'packages' }/` + packageName;

fs.mkdirSync(packageFolder);
generateFilesRecursively(templateFolder, packageFolder);
Expand Down

0 comments on commit abb3011

Please sign in to comment.