From 82813aec03c95cef66dfc852d29c48fe23016fb4 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Thu, 8 Dec 2022 01:34:14 -0500 Subject: [PATCH] The recursive remove doesn't work on Windows. Still not sure if cmd.exe or powershell will be used on all platforms but this rd command works. --- commands/create.js | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/commands/create.js b/commands/create.js index 84cd893..3d1aecc 100644 --- a/commands/create.js +++ b/commands/create.js @@ -46,6 +46,10 @@ export const main = async (target, opts) => { if(opts.keepGit) { log.warn("Keeping the .git directory, so be sure to delete it if you want to do your own work."); } else { - exec_i(`rm -rf ${path.join(target, ".git")}`); + if(process.platform === "win32") { + exec_i(`rd /s /q ${path.join(target, ".git")}`); + } else { + exec_i(`rm -rf ${path.join(target, ".git")}`); + } } } diff --git a/package.json b/package.json index b72da5b..bada739 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ljsthw-bandolier", - "version": "0.3.0", + "version": "0.3.1", "description": "Generates projects using the Bandolier educational framework.", "main": "bando.js", "bin": {