Skip to content

Commit

Permalink
test(process): fixed output messages
Browse files Browse the repository at this point in the history
  • Loading branch information
junajan committed Aug 24, 2016
1 parent 253d716 commit f7c2903
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/coffee/run.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,16 @@ saveProductTypes = (result) ->
console.log "Finished generating files, checking results in target folder: #{argv.target}"
fs.readdirAsync argv.target
.then (files) ->
if not argv.zip
Promise.resolve()
jsonFiles = _.filter files, (file) -> file.match(/\.json/)
if _.isEmpty jsonFiles
Promise.reject "No files were written in target folder #{argv.target}"
else
jsonFiles = _.filter files, (file) -> file.match(/\.json/)
if _.isEmpty jsonFiles
Promise.reject "No files were written in target folder #{argv.target}"
else
console.log "Found #{_.size jsonFiles} files in target folder #{argv.target}"
console.log "Found #{_.size jsonFiles} files in target folder #{argv.target}"
if argv.zip
console.log "Zipping files as #{argv.zipFileName} name"
zipFiles argv.target, argv.zipFileName
else
Promise.resolve()
.catch (e) ->
console.error "Oops, there was an error reading the files in target folder #{argv.target}: #{e.message}"
process.exit 1
Expand Down

0 comments on commit f7c2903

Please sign in to comment.