mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-03-11 06:53:56 +00:00
Simplify data.remove()
This commit is contained in:
parent
d9bfd22909
commit
25d2a10909
@ -1,5 +1,4 @@
|
|||||||
fs = require('fs')
|
fs = require('fs')
|
||||||
fsPlus = require('fs-plus')
|
|
||||||
path = require('path')
|
path = require('path')
|
||||||
rimraf = require('rimraf')
|
rimraf = require('rimraf')
|
||||||
fsUtils = require('./fs-utils/fs-utils')
|
fsUtils = require('./fs-utils/fs-utils')
|
||||||
@ -144,7 +143,4 @@ exports.has = haltIfNoPrefix (key, callback) ->
|
|||||||
#
|
#
|
||||||
exports.remove = haltIfNoPrefix (key, callback) ->
|
exports.remove = haltIfNoPrefix (key, callback) ->
|
||||||
keyPath = constructPath(key)
|
keyPath = constructPath(key)
|
||||||
|
rimraf(keyPath, callback)
|
||||||
fsPlus.isDirectory keyPath, (isDirectory) ->
|
|
||||||
removeFunction = if isDirectory then rimraf else fs.unlink
|
|
||||||
removeFunction(keyPath, callback)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user