2020-01-15 14:09:29 +01:00

28 lines
605 B
JavaScript

/* eslint-disable no-sync */
const fs = require ('fs-extra');
const path = require ('path');
/**
* copies the full template to the current folder
*
* @param {string} folder folder to run in
*/
function run (folder) {
const template = path.join (__dirname, 'template');
fs.copy (template, folder);
}
/**
* checks if the arguments meet the requirements
*
* @param {string} folder folder to run in
* @returns {boolean} true if arguments match requirements
*/
function assert (folder) {
return (typeof folder === 'string')
&& (fs.existsSync (folder));
}
module.exports = { run, assert };