Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(writer): fix makeDir directory tree bug #3235

Closed
wants to merge 1 commit into from

Conversation

ksheedlo
Copy link
Contributor

This fixes the bug from this morning where writer.makeDir was not filling in directory trees before execution finished.

@IgorMinar
Copy link
Contributor

lgtm

@ksheedlo
Copy link
Contributor Author

I would merge this, but I don't have access.

@petebacondarwin
Copy link
Contributor

The q-fs npm module is now deprecated. We should be using q-io instead. This module contains the function makeTree (see http://documentup.com/kriskowal/q-io#filesystem/maketree-path-mode). I think we should upgrade the project to use this module instead of implementing our own algorithms, which would also need to have unit tests by the way :-)

@ksheedlo
Copy link
Contributor Author

@petebacondarwin I know. But I need this fix for a change I'm rolling out. How about I file a new issue and get back to it?

@ksheedlo
Copy link
Contributor Author

Also, there's a possible issue with the way this code is used that I'm not sure makeTree resolves. It's called similarly in a lot of places at the same time. We might have something like

writer.makeDir('build/docs/partials/api/ngFoo');
writer.makeDir('build/docs/partials/api/ngBar');
writer.makeDir('build/docs/partials/api/ngBaz');

All running at the same time, which results in each line of execution trying to make build/docs/partials/api at the same time and consequently failing with EEXIST. Part of the awkwardness of the original code was there for dealing with this problem. If makeTree doesn't fail the way we need it to, we might end up having to chain all the promises together forcing sequential execution, or keep some complicated state representation here, or likely both.

@IgorMinar
Copy link
Contributor

landed as 7ec926f

@IgorMinar IgorMinar closed this Jul 16, 2013
@IgorMinar
Copy link
Contributor

I'm not cherry-picking this to stable because of a merge conflict. also the issue being fixed doesn't seem to be affecting stable so I'm not going to mess with it.

@ksheedlo
Copy link
Contributor Author

@IgorMinar Sounds good

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants