unlhcc / HCCGo

A GUI application for submitting and managing jobs at the Holland Computing Center
6 stars 4 forks source link

Added a command before submission to change to the same directory tha… #216

Closed adamfitzgibbon closed 7 years ago

adamfitzgibbon commented 7 years ago

…t the job file is located in.

Addresses #202

djw8605 commented 7 years ago

You can do 2 commands separated with a semi colon.

-Derek

On Mar 10, 2017, at 1:29 PM, Adam Fitzgibbon notifications@github.com wrote:

@adamfitzgibbon commented on this pull request.

In HCCGo/app/js/ConnectionService.js:

@@ -236,11 +236,13 @@ connectionModule.factory('connectionService',['$log', '$q', '$routeParams', '$lo var submitJob = function(location) { var deferred = $q.defer(); $log.debug("Running command: " + 'sbatch ' + location);

  • runCommand('sbatch ' + location).then(function(data) {
  • deferred.resolve(data);
  • }, function(data) { // thrown on failure
  • $log.log("Error log: " + data)
  • return deferred.reject("An error occurred when submitting the job.");
  • runCommand('cd ' + path.dirname(location)).then(function() {
  • runCommand('sbatch ' + location).then(function(data) { I was thinking about this but I wasn't sure how to test it. Can two commands be run in the same runCommand?

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub, or mute the thread.

adamfitzgibbon commented 7 years ago

Okay that should fix it then.