ipfs-shipyard / ipfs-deploy

Zero-Config CLI to Deploy Static Websites to IPFS
Other
1.15k stars 122 forks source link

Get error path must be a directory #223

Closed ekumahost closed 2 years ago

ekumahost commented 2 years ago

after running ipd file.pdf this works before but not on latest update, how can we deploy file only, this is important

hacdias commented 2 years ago

Hello @ekumahost! Can you elaborate a bit more, please? I understand the issue, I just want to understand why is it an issue to find a better way to fix it.

When selecting a single file, like you do, do you expect it to be wrapped in a directory? Or do you expect that the domain will be pointing directly to the file itself? I will make a solution depending on those expectations.

asbjornenge commented 2 years ago

@hacdias I would expect it to point directly to the file 😅 This would be great! Currently the files are dependent upon one-another since the hash is for the whole directory, but would be super nice to be able to upload single files too 🙌

hacdias commented 2 years ago

@asbjornenge changing this is quite simple (please take a look at #226). The PR adds a warning, but lets it continue. Perhaps this should be a flag instead.

Could you just give me a use case so I can understand? IPFS Deploy is meant to be used to deploy websites. I've never opened a website whose root is just a file and no directory.

asbjornenge commented 2 years ago

Nice 🤩 Well, my current use-case is that I link to content on IPFS for different data - sometimes a JSON blob and sometimes an image etc. Sometimes the json contains links to other data on IPFS. In my mind it makes it clearer to point directly to these individual pieces of data instead of linking to /path/to/filename.json where these paths and/or other files might not be relevant anymore 😅 Makes it easier to grep for the data hash etc.

Has this new feature been released to npm yet?

Thanks 🙌

hacdias commented 2 years ago

I haven't yet. It seems you're using this tool to add any arbitrary file to IPFS. However, this tool is build with websites in mind and that's why I'm very curious about the use case.

asbjornenge commented 2 years ago

Yeah sure 😊 I'm using it for websites too, but arbitrary files also 👍 Another example would be say an image or js library shared between two websites. Both could reference the CID of the image or js lib without having to include them. If the fix is that easy, I don't really see a reason not to add it when clearly people want to use it 😅👍

hacdias commented 2 years ago

Released!