fix(usb): user-config-json-to-bin compile

This commit is contained in:
Róbert Kiss
2017-11-02 19:56:21 +01:00
parent 7ab55e9ac5
commit 009dd8e963
3 changed files with 25 additions and 3 deletions

View File

@@ -1,11 +1,11 @@
import { UhkBuffer, UserConfiguration } from '../uhk-common/src/config-serializer/index';
import { UhkBuffer, UserConfiguration } from 'uhk-common';
import * as fs from 'fs';
const inputFile = process.argv[2];
console.log(inputFile);
const outputFile = process.argv[3];
const config1Js = JSON.parse(fs.readFileSync(inputFile));
const config1Js = JSON.parse(fs.readFileSync(inputFile).toString());
const config1Ts: UserConfiguration = new UserConfiguration().fromJsonObject(config1Js);
const config1Buffer = new UhkBuffer();
config1Ts.toBinary(config1Buffer);