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

10
cli.js
View File

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