From d42a857deacc4ec428e374c9eca4e260d8f6cd4d Mon Sep 17 00:00:00 2001 From: Thadeu Cotts Date: Tue, 24 Nov 2020 12:20:49 -0300 Subject: [PATCH] [copy] [s]: update copy method --- packages/create-portal-app/helpers/copy.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/create-portal-app/helpers/copy.js b/packages/create-portal-app/helpers/copy.js index 96b4fb35..d12cbfa1 100644 --- a/packages/create-portal-app/helpers/copy.js +++ b/packages/create-portal-app/helpers/copy.js @@ -1,16 +1,11 @@ - -const cpy = require("cpy") const path = require("path"); const fs = require('fs'); +const spawn = require('cross-spawn'); module.exports = function copy(root,destination){ const dest_path = [process.cwd(), destination].join(path.sep) if(fs.existsSync(dest_path)){ if(fs.readdirSync(dest_path).length > 0) return Promise.reject(`directory ${dest_path} exist and not empty`); } - return cpy(root, dest_path); + return spawn.sync('cp', ['-r', root, dest_path]); } - -// (async ()=> { -// await copy([process.cwd(),"templates"].join(path.sep), "newme"); -// })().catch(e=> console.log(chalk.red(e))); \ No newline at end of file