 async = require 'async'
 cheerio = require 'cheerio'
+fs = require 'fs-extra'
 glob = require 'glob'
+path = require 'path'
 _ = require 'lodash'
 
 hlp = require './helpers'

  async_tasks = {
    # Default
    settings: getSettings
    championTest: ['settings', permissions.championTest]
    riotVer: ['championTest', getRiotVer]
    champs_json: ['riotVer', getChamps]
    champs: ['champs_json', champNames]
    manaless: ['champs_json', genManaless]

  window.cSettings = preferences.get().options
  preferences.save step


###*
 * Function Clears electrons cache if it exists.
 * @callback {Function} Callback.
###
clearCache = (step) ->
  cache_directory = path.join preferences.directory(), 'Cache'
  if fs.existsSync(cache_directory)
    fs.remove cache_directory, (err) ->
      step(err)
  else
    step()

###*
 * Function Gets the latest Riot Version.
