mirror of
https://github.com/tomru/switchmon.git
synced 2026-03-03 06:27:23 +01:00
flatten promise chain
Got problems making test work with the old way - sigh
This commit is contained in:
10
cli.js
10
cli.js
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user