Creating empty folders on hyper:// protocol has incorrect path resolution behaviour
Environment
Windows 10 64-bit Agregore v1.0.0-29
Creating a new folder via the fetch interface creates a bunch of intermediate folders that seem to be relating to Agregore's installation location.
Steps to reproduce
- Create a new hyperdrive like so
fetch("hyper://folder-creation-bug", {method: "PUT"});
- Write an empty folder to that hyperdrive
fetch("hyper://folder-creation-bug/new-folder/", {method: "PUT"});
- Navigate to the hyperdrive in the browser view
Expected behaviour
An empty hyperdrive save for the folder "new-folder"
Actual behaviour
The hyperdrive contains a series of nested folders corresponding to agregore's install location before the newly created folder (e.g. hyper://folder-creation-bug/Users/Delta/AppData/Local/Programs/agregore-browser/new-folder/)

Additional details
PUTting a new file into an intermediary folder like so:
fetch("hyper://folder-creation-bug/new-folder/test.json", {method: "PUT", body: "{key: 'value', foo: ['bar']}"});
produces the expected results, and creates new-folder at the root level of the hyperdrive.

Thanks for reporting this!
Not sure why it's doing that. :/ Had a theory, but the code seems to be straightforward. https://github.com/RangerMauve/dat-fetch/blob/master/index.js#L164
Should be a quick fix. Kinda swamped with work right now though so help would be appreciated.
Doing some more experiments.
fetch("hyper://folder-creation-bug/another-one/test.json", {method: "PUT", body: "['test2']"})
Produces an empty folder called "another-one" inside the /Users/Delta/AppData/... nonsense, but also correctly creates /another-one/test.json at the hyperdrive root. I think this means that archive.createWriteStream is already properly handling folder creation, and so https://github.com/RangerMauve/dat-fetch/blob/master/index.js#L166-L169 can be deleted. This only leaves the creation of empty folders to be handled.
I think this is a Windows issue. A fix for this would be very much appreciated. 😅