Skip to content

Commit e75b9bf

Browse files
authored
Add promise support for missing fs methods (#1045)
* Add promise support for missing fs methods Fixes #1044 * Try specifying macOS runner explicitly
1 parent d96f265 commit e75b9bf

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
node: [14.x, 16.x, 18.x, 19.x]
15-
os: [ubuntu-latest, macos-latest, windows-latest]
15+
os: [ubuntu-latest, macos-13, windows-latest]
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- uses: actions/checkout@v3

lib/fs/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ const api = [
1111
'chown',
1212
'close',
1313
'copyFile',
14+
'cp',
1415
'fchmod',
1516
'fchown',
1617
'fdatasync',
1718
'fstat',
1819
'fsync',
1920
'ftruncate',
2021
'futimes',
22+
'glob',
2123
'lchmod',
2224
'lchown',
25+
'lutimes',
2326
'link',
2427
'lstat',
2528
'mkdir',
@@ -34,6 +37,7 @@ const api = [
3437
'rm',
3538
'rmdir',
3639
'stat',
40+
'statfs',
3741
'symlink',
3842
'truncate',
3943
'unlink',
@@ -42,6 +46,8 @@ const api = [
4246
].filter(key => {
4347
// Some commands are not available on some systems. Ex:
4448
// fs.cp was added in Node.js v16.7.0
49+
// fs.statfs was added in Node v19.6.0, v18.15.0
50+
// fs.glob was added in Node.js v22.0.0
4551
// fs.lchown is not available on at least some Linux
4652
return typeof fs[key] === 'function'
4753
})

0 commit comments

Comments
 (0)