diff --git a/packages/usb/package.json b/packages/usb/package.json index f2be05c9..7ffe979c 100644 --- a/packages/usb/package.json +++ b/packages/usb/package.json @@ -4,8 +4,15 @@ "description": "Agent USB scripts", "main": "uhk.js", "license": "GPL-3.0", + "scripts": { + "build": "npm run chmod", + "tsc": "tsc", + "chmod": "shx chmod u+x ./*.ts", + "watch": "tsc -w" + }, "devDependencies": { "@types/node": "8.0.28", + "shx": "0.2.2", "typescript": "2.5.3" }, "dependencies": { diff --git a/packages/usb/tsconfig.json b/packages/usb/tsconfig.json index 96b94c46..3206d971 100644 --- a/packages/usb/tsconfig.json +++ b/packages/usb/tsconfig.json @@ -8,7 +8,6 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "target": "es2016", - "outDir": "./dist", "typeRoots": [ "node_modules/@types" ], diff --git a/packages/usb/user-config-json-to-bin.ts b/packages/usb/user-config-json-to-bin.ts index 19833eea..c9f11dde 100755 --- a/packages/usb/user-config-json-to-bin.ts +++ b/packages/usb/user-config-json-to-bin.ts @@ -1,9 +1,12 @@ #!/usr/bin/env ts-node +/// + import { UhkBuffer, UserConfiguration } from 'uhk-common'; import * as fs from 'fs'; +import * as path from 'path'; const outputFile = process.argv[2]; -const inputFile = `${__dirname}/../uhk-web/src/app/services/user-config.json`; +const inputFile = path.join(__dirname, '/../uhk-web/src/app/services/user-config.json'); const config1Js = JSON.parse(fs.readFileSync(inputFile).toString()); const config1Ts: UserConfiguration = new UserConfiguration().fromJsonObject(config1Js); const config1Buffer = new UhkBuffer();