Skip to content

Commit

Permalink
Update variable name for make:template command.
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Feb 23, 2020
1 parent 6630556 commit 5a6fd51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Expand Up @@ -45,14 +45,14 @@ module.exports = () => {
}

try {
const layout = fs.readFileSync(`${__dirname}/stubs/template.njk`, 'utf-8')
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}`)

if (fs.existsSync(destination)) {
throw(`Error: ${destination} already exists.`)
}

fs.outputFileSync(destination, layout)
fs.outputFileSync(destination, template)
console.log(`✔ Successfully created new Template in ${destination}`)
} catch (error) {
throw error
Expand Down

0 comments on commit 5a6fd51

Please sign in to comment.