Closed Grinderofl closed 8 years ago
Hey! So I have to be 100% honest... this is my first node project :P I am used to Python... which is 100% synchronous and fails fast. Node is neither, so I may not have set things up well for debugging.
Maybe you could put a simple case that fails this way onto GitHub?
@Grinderofl I just looked at the code again... It definitely does not do what it is meant to do, whoops! It basically moves everything into it's final location after the first item in that array is accomplished.
Will need to use the node tool async
to build a "series" of mv
callback actions and then let them run in a sequence.
I fixed a bunch of issues... https://github.com/everysquare/pollinate/commit/4f02011873cb563d884de412823fa1fd990de5f4
Though mv
itself will error if you trying to move something to a path where a subdirectory does not yet exist. At least it errors now!
Nesting will need more thinking
I think it will need to do something like run mkdirp
for each path (minus the file). Then try to run mv
. Maybe need a good regex for this.
@Grinderofl I think this should work for you now with 0.0.45
... https://github.com/everysquare/pollinate/commit/8e1c4ac410f257059152616455c0a74495fc9c41
This is my move section:
I have structure like this:
When running the command
pollinate ./ProsperoTemplate --name=Sample
I expect the structure to end up:
However, when running once, I get:
I delete entire Sample\ directory and rerun the command, and end up with
I suspect there's a concurrency issue somewhere, although I can't tell why just by looking at the source, seems a fairly standard synchronous loop, so I assume the mv is non-blocking...