flatten promise chain

Got problems making test work with the old way - sigh
This commit is contained in:
Thomas Ruoff
2016-03-08 22:31:22 +01:00
parent e881214463
commit a82891c9e8

12
cli.js
View File

@@ -41,11 +41,9 @@ if (argv.help || argv.h) {
console.log('Switching on', selectedMonitors); console.log('Switching on', selectedMonitors);
devices devices.then(devices => {
.then(swm.generateXrandrOptions.bind(null, selectedMonitors)) const xrandrOptions = swm.generateXrandrOptions(selectedMonitors, devices);
.then(swm.switchDevices) swm.switchDevices(xrandrOptions);
.then(swm.executePostCmd.bind(null, postCmd)) swm.executePostCmd(postCmd);
.catch(err => { });
console.error(err);
});
} }