Skip to content

Commit

Permalink
Add promise support for missing fs methods (#1045)
Browse files Browse the repository at this point in the history
* Add promise support for missing fs methods

Fixes #1044

* Try specifying macOS runner explicitly
  • Loading branch information
RyanZim authored Jan 14, 2025
1 parent d96f265 commit e75b9bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
node: [14.x, 16.x, 18.x, 19.x]
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-13, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 6 additions & 0 deletions lib/fs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ const api = [
'chown',
'close',
'copyFile',
'cp',
'fchmod',
'fchown',
'fdatasync',
'fstat',
'fsync',
'ftruncate',
'futimes',
'glob',
'lchmod',
'lchown',
'lutimes',
'link',
'lstat',
'mkdir',
Expand All @@ -34,6 +37,7 @@ const api = [
'rm',
'rmdir',
'stat',
'statfs',
'symlink',
'truncate',
'unlink',
Expand All @@ -42,6 +46,8 @@ const api = [
].filter(key => {
// Some commands are not available on some systems. Ex:
// fs.cp was added in Node.js v16.7.0
// fs.statfs was added in Node v19.6.0, v18.15.0
// fs.glob was added in Node.js v22.0.0
// fs.lchown is not available on at least some Linux
return typeof fs[key] === 'function'
})
Expand Down

0 comments on commit e75b9bf

Please sign in to comment.