bare-fs 4.8.2 → 4.8.4
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/binding.c +1 -1
- package/index.js +30 -6
- package/package.json +1 -1
- package/prebuilds/android-arm/bare-fs.bare +0 -0
- package/prebuilds/android-arm64/bare-fs.bare +0 -0
- package/prebuilds/android-ia32/bare-fs.bare +0 -0
- package/prebuilds/android-x64/bare-fs.bare +0 -0
- package/prebuilds/darwin-arm64/bare-fs.bare +0 -0
- package/prebuilds/darwin-x64/bare-fs.bare +0 -0
- package/prebuilds/ios-arm64/bare-fs.bare +0 -0
- package/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
- package/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
- package/prebuilds/linux-arm64/bare-fs.bare +0 -0
- package/prebuilds/linux-x64/bare-fs.bare +0 -0
- package/prebuilds/win32-arm64/bare-fs.bare +0 -0
- package/prebuilds/win32-x64/bare-fs.bare +0 -0
package/binding.c
CHANGED
|
@@ -294,7 +294,7 @@ bare_fs_request_result_stat(js_env_t *env, js_callback_info_t *info) {
|
|
|
294
294
|
uv_timespec_t time = req->handle.statbuf.st_##property; \
|
|
295
295
|
\
|
|
296
296
|
js_value_t *value; \
|
|
297
|
-
err = js_create_int64(env, time.tv_sec * 1000 + time.tv_nsec / 1000000, &value); \
|
|
297
|
+
err = js_create_int64(env, (int64_t) time.tv_sec * 1000 + time.tv_nsec / 1000000, &value); \
|
|
298
298
|
assert(err == 0); \
|
|
299
299
|
\
|
|
300
300
|
err = js_set_element(env, result, i++, value); \
|
package/index.js
CHANGED
|
@@ -1469,6 +1469,20 @@ async function cp(src, dst, opts, cb) {
|
|
|
1469
1469
|
} else if (st.isFile()) {
|
|
1470
1470
|
await copyFile(src, dst)
|
|
1471
1471
|
await chmod(dst, st.mode)
|
|
1472
|
+
} else if (st.isSymbolicLink()) {
|
|
1473
|
+
try {
|
|
1474
|
+
if (!(await lstat(dst)).isDirectory()) await unlink(dst)
|
|
1475
|
+
} catch (e) {
|
|
1476
|
+
if (e.code !== 'ENOENT') throw e
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
await symlink(await readlink(src), dst)
|
|
1480
|
+
} else {
|
|
1481
|
+
throw new FileError('cannot copy a special file', {
|
|
1482
|
+
operation: 'cp',
|
|
1483
|
+
code: 'ENOTSUP',
|
|
1484
|
+
path: src
|
|
1485
|
+
})
|
|
1472
1486
|
}
|
|
1473
1487
|
} catch (e) {
|
|
1474
1488
|
err = e
|
|
@@ -1503,6 +1517,20 @@ function cpSync(src, dst, opts = {}) {
|
|
|
1503
1517
|
} else if (st.isFile()) {
|
|
1504
1518
|
copyFileSync(src, dst)
|
|
1505
1519
|
chmodSync(dst, st.mode)
|
|
1520
|
+
} else if (st.isSymbolicLink()) {
|
|
1521
|
+
try {
|
|
1522
|
+
if (!lstatSync(dst).isDirectory()) unlinkSync(dst)
|
|
1523
|
+
} catch (e) {
|
|
1524
|
+
if (e.code !== 'ENOENT') throw e
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
symlinkSync(readlinkSync(src), dst)
|
|
1528
|
+
} else {
|
|
1529
|
+
throw new FileError('cannot copy a special file', {
|
|
1530
|
+
operation: 'cp',
|
|
1531
|
+
code: 'ENOTSUP',
|
|
1532
|
+
path: src
|
|
1533
|
+
})
|
|
1506
1534
|
}
|
|
1507
1535
|
}
|
|
1508
1536
|
|
|
@@ -1736,9 +1764,7 @@ async function symlink(target, filepath, type, cb) {
|
|
|
1736
1764
|
target = path.resolve(filepath, '..', target)
|
|
1737
1765
|
|
|
1738
1766
|
try {
|
|
1739
|
-
type = (await stat(target)).isDirectory()
|
|
1740
|
-
? constants.UV_FS_SYMLINK_DIR
|
|
1741
|
-
: constants.UV_FS_SYMLINK_JUNCTION
|
|
1767
|
+
type = (await stat(target)).isDirectory() ? constants.UV_FS_SYMLINK_DIR : 0
|
|
1742
1768
|
} catch {
|
|
1743
1769
|
type = 0
|
|
1744
1770
|
}
|
|
@@ -1791,9 +1817,7 @@ function symlinkSync(target, filepath, type) {
|
|
|
1791
1817
|
target = path.resolve(filepath, '..', target)
|
|
1792
1818
|
|
|
1793
1819
|
try {
|
|
1794
|
-
type = statSync(target).isDirectory()
|
|
1795
|
-
? constants.UV_FS_SYMLINK_DIR
|
|
1796
|
-
: constants.UV_FS_SYMLINK_JUNCTION
|
|
1820
|
+
type = statSync(target).isDirectory() ? constants.UV_FS_SYMLINK_DIR : 0
|
|
1797
1821
|
} catch {
|
|
1798
1822
|
type = 0
|
|
1799
1823
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|