Skip to content

Commit

Permalink
remove default path
Browse files Browse the repository at this point in the history
  • Loading branch information
markkaylor committed May 31, 2021
1 parent 5bfbf33 commit aad0515
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
12 changes: 6 additions & 6 deletions packages/strapi/bin/strapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ program
.description('Generate a basic plugin')
.action(getLocalScript('generate'));

// `$ strapi generate:template <directory>`
program
.command('generate:template <directory>')
.description('Generate template from Strapi project')
.action(getLocalScript('generate-template'));

program
.command('build')
.option('--clean', 'Remove the build and .cache folders', false)
Expand Down Expand Up @@ -230,10 +236,4 @@ program
.option('-p, --password <password>', 'New password for the user')
.action(getLocalScript('admin-reset'));

// `$ strapi export:template <name>`
program
.command('generate:template <directory>')
.description('Generate template from current Strapi project')
.action(getLocalScript('generate-template'));

program.parseAsync(process.argv);
5 changes: 1 addition & 4 deletions packages/strapi/lib/commands/generate-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ async function templateConfigExists(rootPath) {
}

module.exports = async function generateTemplate(directory) {
// Allow any relative path,
// otherwise default destination is at the same level as the current directory
const dir = directory.startsWith('.') ? directory : `../${directory}`;
const rootPath = resolve(dir);
const rootPath = resolve(directory);

// Get path to template directory: <rootPath>/template
const templatePath = join(rootPath, 'template');
Expand Down

0 comments on commit aad0515

Please sign in to comment.