Skip to content

Commit

Permalink
Issue #58: improve noError logic for shell commands [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
dalehenrich committed Mar 20, 2015
1 parent be5e821 commit bd982ea
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@ runShellCommand: shellCommandPath args: shellArgumentArray noError: noError
FileStream readOnlyFileNamed: errName do: [ :fileStream | stdErr := fileStream contents ].
success
ifFalse: [
Transcript
cr;
show: 'Error running shell command: ' , shellCommandPath printString;
cr;
show: 'with args:'.
shellArgumentArray
do: [ :arg |
noError
ifFalse: [
Transcript
cr;
tab;
show: arg ].
Transcript
cr;
show: 'STDOUT: ' , stdOut printString;
cr;
show: 'STDERR: ' , stdErr.
noError
ifFalse: [ self error: 'Shell command: ' , shellCommandPath printString , ' failed.' ] ].
show: 'Error running shell command: ' , shellCommandPath printString;
cr;
show: 'with args:'.
shellArgumentArray
do: [ :arg |
Transcript
cr;
tab;
show: arg ].
Transcript
cr;
show: 'STDOUT: ' , stdOut printString;
cr;
show: 'STDERR: ' , stdErr.
self error: 'Shell command: ' , shellCommandPath printString , ' failed.' ] ].
^ stdOut
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
"isAbstract" : "dkh 7/19/2014 07:48",
"runShellCommand:args:" : "dkh 3/20/2015 12:07",
"runShellCommand:args:noError:" : "dkh 3/20/2015 12:07" },
"runShellCommand:args:noError:" : "dkh 3/20/2015 13:09" },
"instance" : {
"backupsHome" : "dkh 7/19/2014 17:46",
"binHome" : "dkh 7/30/2014 15:34",
Expand Down

0 comments on commit bd982ea

Please sign in to comment.