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