diff --git a/desktop-app/js/controllers.js b/desktop-app/js/controllers.js index 7866c81..d6f87fb 100644 --- a/desktop-app/js/controllers.js +++ b/desktop-app/js/controllers.js @@ -53,11 +53,6 @@ angular.module( "os-updater.controllers", [] ).controller( "HomeCtrl", function( // Execute the AVRDUDE command and parse the reply exec( command, { timeout: 3000 }, function( err, stdout, stderr ) { - if ( err ) { - callback(); - return; - } - stdout = stdout || stderr; var matches = stdout.match( filter ), @@ -137,10 +132,6 @@ angular.module( "os-updater.controllers", [] ).controller( "HomeCtrl", function( // The first command will list all Call-Up serial ports ports: function( callback ) { exec( "ls /dev/cu.*", { timeout: 1000 }, function( err, stdout ) { - if ( err ) { - callback( err ); - return; - } // Return the list delimited by line return callback( null, stdout.split( "\n" ) ); @@ -150,21 +141,12 @@ angular.module( "os-updater.controllers", [] ).controller( "HomeCtrl", function( // The second command requests the USB informatin from system_profiler (command in bash script) devices: function( callback ) { exec( "avr/serial.osx.sh", { timeout: 1000 }, function( err, stdout ) { - if ( err ) { - callback( err ); - return; - } // Return the list delimited by line return callback( null, stdout.split( "\n" ) ); } ); } }, function( err, data ) { - if ( err ) { - cleanUp(); - return; - } - parseDevices( data.devices, data.ports ); } ); } else if ( platform === "linux" ) { @@ -172,11 +154,7 @@ angular.module( "os-updater.controllers", [] ).controller( "HomeCtrl", function( // Handle serial port scan for Linux platform by running shell script // which parses the /sys/bus/usb/devices path for connected devices exec( "./avr/serial.linux.sh", { timeout: 1000 }, function( err, stdout ) { - if ( err ) { - cleanUp(); - } else { - parseDevices( stdout.split( "\n" ), null ); - } + parseDevices( stdout.split( "\n" ), null ); } ); } else if ( platform === "win" ) { var wmic = spawn( "wmic", [] ), @@ -234,11 +212,6 @@ angular.module( "os-updater.controllers", [] ).controller( "HomeCtrl", function( // Execute the AVRDUDE update process and process the result exec( command, function( err, stdout, stderr ) { - if ( err ) { - callback( err ); - return; - } - stdout = stdout || stderr; // At the end of the AVRDUDE command, the flash memory is verified and if successful a message indicating so is displayed @@ -260,7 +233,7 @@ angular.module( "os-updater.controllers", [] ).controller( "HomeCtrl", function( }, function( err, results ) { // Process results once the download and update process has completed. If the status was successful indicate so to the user. - if ( !err && results.status ) { + if ( results.status ) { $scope.button.text = "OpenSprinkler " + type + " is rebooting..."; $scope.$apply();