From c523ded8e97c971204c69d7988f3794fd02929e4 Mon Sep 17 00:00:00 2001 From: MARCROCK22 Date: Sat, 1 Jun 2024 19:01:34 +0000 Subject: [PATCH] fix: _build script --- _build.js | 28 ++++++++++++++++++++++------ package.json | 3 ++- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/_build.js b/_build.js index a4e964f..6fed177 100644 --- a/_build.js +++ b/_build.js @@ -1,9 +1,25 @@ const { execSync } = require("child_process"); -try { - execSync('tsc'); - console.log('[Seyfert]: Builded'); -} catch (e) { - console.error(e); - console.log('[Seyfert]: Builded with errors'); +const commands = [ + 'tsc', + 'bunx tsc', + 'npx tsc', + 'pnpx tsc' +] + +function executeCommands() { + for (const cmd of commands) { + try { + console.log('[Seyfert]:', 'trying to build with `', cmd, '`') + execSync(cmd) + } catch (e) { + if (cmd === commands.at(-1)) { + return console.log('[Seyfert]:', e) + } + } + } + + console.log('[Seyfert]:', 'builded') } + +executeCommands() diff --git a/package.json b/package.json index 45a7cb8..447a4ea 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "module": "./lib/index.js", "types": "./lib/index.d.ts", "files": [ - "lib/**" + "lib/**", + "./_build.js" ], "scripts": { "build": "tsc --outDir ./lib",