Skip to content
This repository has been archived by the owner on Apr 15, 2021. It is now read-only.

Commit

Permalink
fix: Load JSON from file before handing to buttplug loading function
Browse files Browse the repository at this point in the history
buttplug-js expects a string that is a JSON block for device config
loading, not a file path.

Fixes #5
  • Loading branch information
qdot committed Aug 3, 2019
1 parent 2621bf1 commit 76c1c2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ButtplugServerCLI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export class ButtplugServerCLI {
// If we are passed a device configuration file, use that. Otherwise, use
// the one built into the library.
if (commander.deviceconfig) {
DeviceConfigurationManager.LoadFromJsonExternalConfig(commander.deviceconfig);
const configStr = fs.readFileSync(commander.deviceconfig).toString("utf-8");
DeviceConfigurationManager.LoadFromJsonExternalConfig(configStr);
} else {
DeviceConfigurationManager.LoadFromInternalConfig();
}
Expand Down

0 comments on commit 76c1c2b

Please sign in to comment.