 fs            = require 'fs'
 _             = require 'lodash'
 W             = require 'when'
+nodefn        = require 'when/node'
 sprout        = require 'sprout'
 global_config = require '../global_config'
 

 * @private
 * @param  {Object} deferred - deferred object
 * @return {Promise} promise for finished task
###

remove_roots_config = (deferred) ->
  tasks = []
  for tpl in _.without(sprout.list(), 'roots-base')
    tasks.push(sprout.remove(tpl))

  W.all(tasks)
    .then(-> fs.unlinkSync(global_config().path))
    .yield('config and templates reset')
    .done(deferred.resolve, deferred.reject)


 *
 * @param  {Boolean} override - do not confirm via stdin if true
 * @return {Promise} a promise for reset templates
 *
 * istanbul ignore next
###

exports.reset = (override) ->
