mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-10 01:15:06 +02:00
Remove fs-extra dependency
This commit is contained in:
parent
1ad46d4fb8
commit
d0af1c3c9a
57 changed files with 1763 additions and 55 deletions
22
server/libs/fsExtra/remove/index.js
Normal file
22
server/libs/fsExtra/remove/index.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
'use strict'
|
||||
|
||||
const fs = require('graceful-fs')
|
||||
const u = require('../../universalify').fromCallback
|
||||
const rimraf = require('./rimraf')
|
||||
|
||||
function remove(path, callback) {
|
||||
// Node 14.14.0+
|
||||
if (fs.rm) return fs.rm(path, { recursive: true, force: true }, callback)
|
||||
rimraf(path, callback)
|
||||
}
|
||||
|
||||
function removeSync(path) {
|
||||
// Node 14.14.0+
|
||||
if (fs.rmSync) return fs.rmSync(path, { recursive: true, force: true })
|
||||
rimraf.sync(path)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
remove: u(remove),
|
||||
removeSync
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue