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:
18
test/fixtures/mnt.js
vendored
18
test/fixtures/mnt.js
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user