From fcca124c20a4e2d93800f3d05bc533bd4e3c49d3 Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Fri, 22 Mar 2024 02:32:11 -0500 Subject: [PATCH] s --- src/commands/build.ts | 2 +- templates/cf.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/commands/build.ts b/src/commands/build.ts index 4fc83fe..d897559 100644 --- a/src/commands/build.ts +++ b/src/commands/build.ts @@ -154,7 +154,7 @@ export async function build(options: Record) { console.log(commandsPaths) const commandsImports = commandsPaths.map(file => { const fname = p.parse(file) - return `import ${fname.name} from "./${p.join(`./commands/${file}`).replace(/\\/g, '/')}"` + return `import ${fname.name} from "./${p.join(`./commands/${file}`).split(p.sep).join(p.posix.sep)}"` }); console.log(commandsImports) await esbuild.build({ diff --git a/templates/cf.js b/templates/cf.js index fe23a95..54afbed 100644 --- a/templates/cf.js +++ b/templates/cf.js @@ -21,6 +21,21 @@ class JsonResponse extends Response { } } +async function executeModule( + emitter, + logger, + errHandler, + { module, task, args }, +) { + try { + await module.execute(args); + emitter.emit('module.activate', /*resultPayload(PayloadType.Success, module)*/); + } catch(e) { + throw e /* { } */ + } + +} + const router = Router(); /**