diff --git a/package.json b/package.json index 83b8785..dbf0297 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "description": "", "main": "index.js", "scripts": { - "build-ts": "esbuild compilar.ts --target=node18 --outdir=build.js --sourcemap", - "build": "pnpm build-ts && node build.js/compilar.js", - "check": "tsc --noEmit" + "build-ts": "./tool build_ts", + "build": "./tool build", + "check": "./tool tsc" }, "keywords": [], "author": "", diff --git a/tool b/tool new file mode 100755 index 0000000..d792489 --- /dev/null +++ b/tool @@ -0,0 +1,20 @@ +#!/bin/sh + +build_ts() { + ./node_modules/.bin/esbuild compilar.ts --target=node18 --outdir=build.js --sourcemap +} +build() { + build_ts + node build.js/compilar.js +} +check() { + ./node_modules/.bin/tsc --noEmit +} + +fatal() { + echo "$1" + exit 1 +} + +test "$1" = build_ts -o "$1" = build -o "$1" = check || fatal "Comando no vĂ¡lido" +"$1"