     switch type
       when "add" then config.add("appliedMods", {repo: mod.repo.name, name: mod.name})
       when "delete" then config.remove("appliedMods", {repo: mod.repo.name, name: mod.name})
-    callback("done", type, mod)
-    fs.remove(TEMP_FOLDER)
+    log("done")
   catch err
-    fs.remove(TEMP_FOLDER)
-    callback("fail", type, mod, err)
+    progress("fail", type, mod, err)
+  fs.remove(TEMP_FOLDER)
   return
 
 ###*

      when "add" then folder = "install"
      when "delete" then folder = "remove"
      else throw new Error("Unknown type")

    log = (phase) ->
      return callback(phase, type, mod)

    if mod.repo.type is "remote"
      stream = _getFromRemote(folder, mod, log)

 * MODを適応します
 * @param {"add"|"delete"} type 適応するか解除するか
 * @param {string} mod "{repo: {type: repoType, name: repo}, name: name}"
 * @param {Function} progress 進捗報告
 * @return {Promise}
 ###
applyMod = (type, mod, progress) ->
  pathType = config.get("blitzPathType")
  if pathType is "folder"
    outputFolder = path.normalize(config.get("blitzPath"))
  else
    outputFolder = TEMP_FOLDER

  log = (phase) ->
    return progress(phase, type, mod)

  try
    pathList = new Set()
    await fs.ensureDir(outputFolder)
