bare-fs 2.1.4 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -636,14 +636,14 @@ function mkdir (filepath, opts, cb) {
|
|
|
636
636
|
|
|
637
637
|
const mode = typeof opts.mode === 'number' ? opts.mode : 0o777
|
|
638
638
|
|
|
639
|
-
if (opts.recursive) return mkdirRecursive(filepath, mode, cb)
|
|
639
|
+
if (opts.recursive) return mkdirRecursive(filepath.replace(/\//g, path.sep), mode, cb)
|
|
640
640
|
|
|
641
641
|
const req = getReq()
|
|
642
642
|
req.callback = cb
|
|
643
643
|
binding.mkdir(req.handle, filepath, mode)
|
|
644
644
|
}
|
|
645
645
|
|
|
646
|
-
function
|
|
646
|
+
function mkdirRecursiveSync (filepath, mode) {
|
|
647
647
|
try {
|
|
648
648
|
mkdirSync(filepath, { mode })
|
|
649
649
|
} catch (err) {
|
|
@@ -655,7 +655,7 @@ function mkdirResursiveSync (filepath, mode) {
|
|
|
655
655
|
const i = filepath.lastIndexOf(path.sep)
|
|
656
656
|
if (i <= 0) throw err
|
|
657
657
|
|
|
658
|
-
|
|
658
|
+
mkdirRecursiveSync(filepath.slice(0, i), { mode })
|
|
659
659
|
|
|
660
660
|
try {
|
|
661
661
|
mkdirSync(filepath, { mode })
|
|
@@ -679,7 +679,7 @@ function mkdirSync (filepath, opts) {
|
|
|
679
679
|
|
|
680
680
|
const mode = typeof opts.mode === 'number' ? opts.mode : 0o777
|
|
681
681
|
|
|
682
|
-
if (opts.recursive) return
|
|
682
|
+
if (opts.recursive) return mkdirRecursiveSync(filepath.replace(/\//g, path.sep), mode)
|
|
683
683
|
|
|
684
684
|
binding.mkdirSync(filepath, mode)
|
|
685
685
|
}
|
|
@@ -1016,7 +1016,7 @@ function symlink (target, filepath, type, cb) {
|
|
|
1016
1016
|
stat(target, (err, st) => {
|
|
1017
1017
|
type = err === null && st.isDirectory() ? constants.UV_FS_SYMLINK_DIR : constants.UV_FS_SYMLINK_JUNCTION
|
|
1018
1018
|
|
|
1019
|
-
symlink(target, filepath, type,
|
|
1019
|
+
symlink(target, filepath, type, cb)
|
|
1020
1020
|
})
|
|
1021
1021
|
|
|
1022
1022
|
return
|