Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix writable path check in diagnose (#512)
The `fs.accessSync` in the `isWriteableFile` function only checked if the path was readable with `fs.constants.R_OK`. Not if it was writable with `fs.constants.W_OK`. > - `F_OK`: Flag indicating that the file is visible to the calling > process. This is useful for determining if a file exists, but says > nothing about rwx permissions. Default if no mode is specified. > - `R_OK`: Flag indicating that the file can be read by the calling > process. > - `W_OK`: Flag indicating that the file can be written by the calling > process. > - `X_OK`: Flag indicating that the file can be executed by the > calling process. This has no effect on Windows (will behave like > fs.constants.F_OK). Source: https://nodejs.org/api/fs.html#file-access-constants I've also renamed the function to `isWriteable` because it doesn't only check files, but also directories.
- Loading branch information