       targetFolder: argv.sftpTarget
       logger: logger
 
-    processFn = (files, fn) ->
-      throw new Error 'Please provide a function to process the files' unless _.isFunction fn
-      d = Q.defer()
-      _process = (tick) ->
-        logger.info tick, 'Current tick'
-        if tick >= files.length
-          logger.info 'No more files, resolving...'
-          d.resolve()
-        else
-          file = files[tick]
-          fn(file)
-          .then ->
-            logger.info "Finishing processing file #{file}"
-            sftpHelper.finish(file)
-          .then ->
-            _process(tick + 1)
-          .fail (error) -> d.reject error
-          .done()
-      _process(0)
-      d.promise
-
     sftpHelper.download(TMP_PATH)
     .then (files) ->
       logger.info files, "Processing #{files.length} files..."

    .fail (error) ->
      logger.error error, 'Oops, something went wrong!'
      process.exit(1)

      logger: logger

  stockimport = new StockImport options

  file = argv.file

