Make saving the configuration more robust (#594)
* feat: Make saving the configuration more robust * parse backup user config before return * fix some bug * Add write-userconfig.js and invalid-config.bin * throw exception if failed user config parsing * Merge branch 'master' into feat-467-make-save-more-robust * hide keymaps and macros if agent in restore mode * fix Device name settings
This commit is contained in:
committed by
László Monda
parent
00c5b69129
commit
13ec617d58
21
packages/usb/write-userconfig.js
Executable file
21
packages/usb/write-userconfig.js
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env node
|
||||
const fs = require('fs');
|
||||
const program = require('commander');
|
||||
const uhk = require('./uhk');
|
||||
|
||||
(async function() {
|
||||
program
|
||||
.usage(`configPath`)
|
||||
.parse(process.argv);
|
||||
|
||||
if (program.args.length < 1) {
|
||||
console.error('No configPath path specified.');
|
||||
exit(1);
|
||||
}
|
||||
const configPath = program.args[0];
|
||||
|
||||
const device = uhk.getUhkDevice();
|
||||
const configBuffer = fs.readFileSync(configPath);
|
||||
await uhk.writeConfig(device, configBuffer, false);
|
||||
await uhk.launchEepromTransfer(device, uhk.eepromOperations.write, uhk.configBufferIds.stagingUserConfig);
|
||||
})();
|
||||
Reference in New Issue
Block a user