mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-04 04:54:09 +00:00
20 lines
443 B
CoffeeScript
20 lines
443 B
CoffeeScript
async = require('async')
|
|
fs = require('fs')
|
|
widgets = require('../widgets/widgets')
|
|
ProgressBar = require('progress')
|
|
|
|
exports.remove = (name, confirmAttribute, deleteFunction, outerCallback) ->
|
|
async.waterfall([
|
|
|
|
(callback) ->
|
|
if confirmAttribute
|
|
return callback(null, true)
|
|
|
|
widgets.confirmRemoval(name, callback)
|
|
|
|
(confirmed, callback) ->
|
|
return callback() if not confirmed
|
|
deleteFunction(callback)
|
|
|
|
], outerCallback)
|