2014-11-21 17:23:29 +00:00
|
|
|
async = require('async')
|
2014-12-02 15:08:22 +00:00
|
|
|
fs = require('fs')
|
2014-11-26 17:27:57 +00:00
|
|
|
widgets = require('../widgets/widgets')
|
2014-12-02 21:40:13 +00:00
|
|
|
ProgressBar = require('progress')
|
2014-11-21 17:23:29 +00:00
|
|
|
|
|
|
|
exports.remove = (name, confirmAttribute, deleteFunction, outerCallback) ->
|
|
|
|
async.waterfall([
|
|
|
|
|
|
|
|
(callback) ->
|
|
|
|
if confirmAttribute
|
|
|
|
return callback(null, true)
|
|
|
|
|
2014-11-26 17:27:57 +00:00
|
|
|
widgets.confirmRemoval(name, callback)
|
2014-11-21 17:23:29 +00:00
|
|
|
|
|
|
|
(confirmed, callback) ->
|
|
|
|
return callback() if not confirmed
|
|
|
|
deleteFunction(callback)
|
|
|
|
|
|
|
|
], outerCallback)
|