Skip to content

fix: write file to the current folder #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2020

Conversation

bzoz
Copy link
Contributor

@bzoz bzoz commented Jun 4, 2020

Trying to run:

ncu-ci walk pr --stats=true --cache=true --markdown results.md

will fail with:

Error: ENOENT: no such file or directory, mkdir
    at Object.mkdirSync (fs.js:940:3)
    at exports.writeFile (C:\Users\ja\AppData\Local\nvs\node\14.1.0\x64\node_modules\node-core-utils\lib\file.js:19:8)
    at WalkCommand.serialize (C:\Users\ja\AppData\Local\nvs\node\14.1.0\x64\node_modules\node-core-utils\bin\ncu-ci:229:9)
    at main (C:\Users\ja\AppData\Local\nvs\node\14.1.0\x64\node_modules\node-core-utils\bin\ncu-ci:371:24)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  errno: -4058,
  syscall: 'mkdir',
  code: 'ENOENT'
}

(at least on Windows).

This fixes this by first checking if there is any folder to create before calling mkdir.

@codecov
Copy link

codecov bot commented Jun 4, 2020

Codecov Report

Merging #434 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #434   +/-   ##
=======================================
  Coverage   77.13%   77.13%           
=======================================
  Files          21       21           
  Lines        1496     1496           
=======================================
  Hits         1154     1154           
  Misses        342      342           
Impacted Files Coverage Δ
lib/file.js 78.26% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d82a73...17c8c32. Read the comment docs.

@codebytere codebytere merged commit 5974797 into nodejs:master Jun 6, 2020
codebytere pushed a commit to codebytere/node-core-utils that referenced this pull request Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants