1
0
mirror of https://github.com/fuse-friends/fuse-native synced 2026-03-02 03:40:15 +00:00

Add mkdir option + update README

This commit is contained in:
Andrew Osheroff
2020-01-29 13:19:39 +01:00
parent 95386bf49c
commit 7a1d439e9c
9 changed files with 72 additions and 15 deletions

18
test/fixtures/mnt.js vendored
View File

@@ -2,12 +2,18 @@ var os = require('os')
var path = require('path')
var fs = require('fs')
var mnt = path.join(os.tmpdir(), 'fuse-bindings-' + process.pid + '-' + Date.now())
function create (opts = {}) {
var mnt = path.join(os.tmpdir(), 'fuse-bindings-' + process.pid + '-' + Date.now())
try {
fs.mkdirSync(mnt)
} catch (err) {
// do nothing
if (!opts.doNotCreate) {
try {
fs.mkdirSync(mnt)
} catch (err) {
// do nothing
}
}
return mnt
}
module.exports = mnt
module.exports = create