Nicer use of spawn

This commit is contained in:
Pablo Carranza Velez 2016-01-14 18:15:26 +00:00
parent 9dd1fa2408
commit 676f6699fe

View File

@ -88,7 +88,7 @@ exports.rsyncImageWithProgress = (imgDest, onProgress, startFromEmpty = false) -
return [ rsyncDiff, imageConfig, imgSrc ]
.spread (rsyncDiff, imageConfig, imgSrc) ->
new Promise (resolve, reject) ->
dockersync = spawn('/app/src/dockersync.sh', [ imgSrc, imgDest, JSON.stringify(imageConfig) ], stdio: [ 'pipe', 'pipe', 'pipe' ])
dockersync = spawn('/app/src/dockersync.sh', [ imgSrc, imgDest, JSON.stringify(imageConfig) ], stdio: 'pipe')
.on 'error', reject
.on 'exit', (code, signal) ->
if code in DELTA_OUT_OF_SYNC_CODES