From 037c81357fcaba640d095d3927d297ac97598dd6 Mon Sep 17 00:00:00 2001 From: Cosmin Popovici Date: Sun, 23 Feb 2020 15:32:59 +0200 Subject: [PATCH] Rename --dir option. --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index a872de8..aa5c272 100644 --- a/src/index.js +++ b/src/index.js @@ -13,7 +13,7 @@ module.exports = () => { cli .command('make:layout ') - .option('-d, --dir ', 'directory where the file should be output') + .option('-d, --directory ', 'directory where the file should be output') .description('scaffold a new Layout') .action((filename, cmdObj) => { if (path.parse(filename).ext === '') { @@ -22,7 +22,7 @@ module.exports = () => { try { const layout = fs.readFileSync(`${__dirname}/stubs/layout.njk`, 'utf-8') - const destination = cmdObj.dir ? path.resolve(`${cmdObj.dir}/${filename}`) : path.resolve(`${process.cwd()}/src/layouts/${filename}`) + const destination = cmdObj.directory ? path.resolve(`${cmdObj.directory}/${filename}`) : path.resolve(`${process.cwd()}/src/layouts/${filename}`) if (fs.existsSync(destination)) { throw(`Error: ${destination} already exists.`) @@ -37,7 +37,7 @@ module.exports = () => { cli .command('make:template ') - .option('-d, --dir ', 'directory where the file should be output') + .option('-d, --directory ', 'directory where the file should be output') .description('scaffold a new Template') .action((filename, cmdObj) => { if (path.parse(filename).ext === '') { @@ -46,7 +46,7 @@ module.exports = () => { try { const template = fs.readFileSync(`${__dirname}/stubs/template.njk`, 'utf-8') - const destination = cmdObj.dir ? path.resolve(`${cmdObj.dir}/${filename}`) : path.resolve(`${process.cwd()}/src/templates/${filename}`) + const destination = cmdObj.directory ? path.resolve(`${cmdObj.directory}/${filename}`) : path.resolve(`${process.cwd()}/src/templates/${filename}`) if (fs.existsSync(destination)) { throw(`Error: ${destination} already exists.`)