Open DeltaF1 opened 3 years ago
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. 😅
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
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
PUT
ting a new file into an intermediary folder like so:produces the expected results, and creates new-folder at the root level of the hyperdrive.