Use rimraf package instead of handmade function

Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
This commit is contained in:
Pablo Carranza Velez 2018-12-11 14:10:55 -03:00
parent af717a3761
commit b94921263a
3 changed files with 971 additions and 2239 deletions

3205
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -78,6 +78,7 @@
"resin-register-device": "^3.0.0",
"balena-sync": "^10.0.0",
"resumable-request": "^2.0.0",
"rimraf": "^2.6.2",
"rwlock": "^5.0.0",
"shell-quote": "^1.6.1",
"ts-loader": "^3.5.0",

View File

@ -10,6 +10,7 @@ network = require './network'
execAsync = Promise.promisify(require('child_process').exec)
mkdirp = Promise.promisify(require('mkdirp'))
path = require 'path'
rimraf = Promise.promisify(require('rimraf'))
constants = require './lib/constants'
validation = require './lib/validation'
@ -44,9 +45,6 @@ validateState = Promise.method (state) ->
if state.dependent?
validateDependentState(state.dependent)
rimraf = (p) ->
execAsync("rm -rf \"#{p.replace(/"/g, '\\"')}\"")
# TODO (refactor): This shouldn't be here, and instead should be part of the other
# device api stuff in ./device-api
createDeviceStateRouter = (deviceState) ->