UNPKG

fot

Version:

A simple tool that lets you start a project without the hassle of creating the same folders over and over again. Create once... and never again.

1 lines 555 B
var fs=require("fs"),shell=require("shelljs"),getTempPath=require("./helpers/getTempPath");module.exports=function(e,t,r){var a=getTempPath();if(-1===fs.readdirSync(a).indexOf(e))throw"ERROR: No template by that name. Please check your templates folder.";var l=a+"\\"+e,n=shell.cp("-r",l,t);if(shell.error())throw"ERROR: Something went wrong while copying the template. Here's what came back: "+n.stderr;return(r&&"string"==typeof r||r instanceof String)&&fs.renameSync(t+"\\"+e,t+"\\"+r),"SUCCESS: Cloned the template files into the current directory."};