fix: _build script

This commit is contained in:
MARCROCK22 2024-06-01 19:01:34 +00:00
parent 24227df8cb
commit c523ded8e9
2 changed files with 24 additions and 7 deletions

View File

@ -1,9 +1,25 @@
const { execSync } = require("child_process"); const { execSync } = require("child_process");
const commands = [
'tsc',
'bunx tsc',
'npx tsc',
'pnpx tsc'
]
function executeCommands() {
for (const cmd of commands) {
try { try {
execSync('tsc'); console.log('[Seyfert]:', 'trying to build with `', cmd, '`')
console.log('[Seyfert]: Builded'); execSync(cmd)
} catch (e) { } catch (e) {
console.error(e); if (cmd === commands.at(-1)) {
console.log('[Seyfert]: Builded with errors'); return console.log('[Seyfert]:', e)
} }
}
}
console.log('[Seyfert]:', 'builded')
}
executeCommands()

View File

@ -6,7 +6,8 @@
"module": "./lib/index.js", "module": "./lib/index.js",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
"files": [ "files": [
"lib/**" "lib/**",
"./_build.js"
], ],
"scripts": { "scripts": {
"build": "tsc --outDir ./lib", "build": "tsc --outDir ./lib",