           Key: file
 
         yield s3.deleteObject params
+        printProgress()
+
     catch e
       console.error "Failed to delete object.", e
       throw new Error()

          Body: createReadStream join config.target, file

        yield s3.putObject params
    catch e
      console.error "Failed to upload object.", e
      throw new Error()


  async ({dlist, ulist}) ->
    console.log "Syncing S3 bucket."
    total = (cat dlist, ulist).length
    currentIndex = 0

    printProgress = ->
      progress = 100 * currentIndex / total
      if progress < 1
        progress = progress.toPrecision(2)
      else if progress < 10
        progress = progress.toPrecision(3)
      else
        progress = progress.toPrecision(4)

      rl.write null, {ctrl: true, name: 'u'}
      rl.write progress + "%"
      currentIndex++
      if currentIndex == total
        rl.write null, {ctrl: true, name: 'u'}
        rl.write "100%"
        rl.write "\n"
        rl.close()


    # Delete Files
    try
      for file in dlist
