mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-22 23:12:22 +00:00
18 lines
387 B
CoffeeScript
18 lines
387 B
CoffeeScript
async = require('async')
|
|
resin = require('../resin')
|
|
|
|
exports.remove = (name, confirmAttribute, deleteFunction, outerCallback) ->
|
|
async.waterfall([
|
|
|
|
(callback) ->
|
|
if confirmAttribute
|
|
return callback(null, true)
|
|
|
|
resin.ui.widgets.confirmRemoval(name, callback)
|
|
|
|
(confirmed, callback) ->
|
|
return callback() if not confirmed
|
|
deleteFunction(callback)
|
|
|
|
], outerCallback)
|