From 30969b5e22a665031f4a20245fe7da3a8309f402 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Mon, 5 Dec 2022 00:28:27 -0500 Subject: [PATCH] Small fixes to path problems on windows. --- bando.ps1 | 1 + commands/create.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 bando.ps1 diff --git a/bando.ps1 b/bando.ps1 new file mode 100644 index 0000000..ad23902 --- /dev/null +++ b/bando.ps1 @@ -0,0 +1 @@ +node ./bando.js $args diff --git a/commands/create.js b/commands/create.js index 3e4b0e1..e30b56c 100644 --- a/commands/create.js +++ b/commands/create.js @@ -33,9 +33,11 @@ export const main = async (target, opts) => { // copy all of the template files to the destination for(let f of temp_files) { // kind of dumb way to trim the middle of the path out - const copy_to = f.replace(`${temp_dir}/`, ''); + const f_normal = path.join(f, ''); // this fixes glob's using / on windows + // use simple string replace to remove the template part + const copy_to = f_normal.replace(`${temp_dir}`, '').replace('\\\\', '\\'); mkdir_to(copy_to); - copy(f, copy_to); // we can add a template thing here - log.debug(`${f} ---> ${copy_to}`); + copy(f_normal, copy_to); // we can add a template thing here + log.debug(`${f_normal} ---> ${copy_to}`); } }