Skip to content
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

fix mkdirp path when processing a source directory #19

Merged
merged 1 commit into from
Sep 13, 2016
Merged

fix mkdirp path when processing a source directory #19

merged 1 commit into from
Sep 13, 2016

Conversation

seep
Copy link
Contributor

@seep seep commented Sep 13, 2016

I was running into an odd issue with async-to-gen --out-dir out src where the tool would try to write files to directories that don't exist. For example, my src directory looked like:

src\
src\index.js
src\subfolder\
src\subfolder\index.js

After running the tool, the out directory looked like

out\
out\index.js
out\src\
out\src\subfolder

and then it would panic when it tried to write to out\subfolder\index.js, because that directory didn't exist. FWIW I'm working on Windows, which might have different behavior for path.join or path.dirname. The above change fixed the issue for me, and I don't see any issues with taking the directory path straight from the output file path, but I can't test it really thoroughly right now.

I was running into an odd issue with `async-to-gen --out-dir out src` where the tool would try to write files to directories that don't exist. For example, my `src` directory looked like:
```
src\
src\index.js
src\subfolder\
src\subfolder\index.js
```
After running the tool, the out directory looked like
```
out\
out\index.js
out\src\
out\src\subfolder
```
and then it would panic when it tried to write to `out\subfolder\index.js`, because that directory didn't exist. FWIW I'm working on Windows, which might have different behavior for `path.join` or `path.dirname`. The above change fixed the issue for me, and I don't see any issues with taking the directory path straight from the output file path, but I can't test it really thoroughly right now.
@leebyron leebyron merged commit e7253aa into leebyron:master Sep 13, 2016
@leebyron
Copy link
Owner

Great catch! Thanks for the fix.

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