MystenLabs / walrus-sites

Walrus Sites: Decentralized Websites using Sui and Walrus.
https://docs.walrus.site/walrus-sites/intro.html
Apache License 2.0
17 stars 16 forks source link

feat(site-builder): on publish raise an error when a file is empty #117

Closed Tzal3x closed 1 month ago

Tzal3x commented 1 month ago

So far the site-builder was silently ignoring empty files.

This PR adds a check that raises an error when an empty file is included in the directory that is to be published. Also, the check should be done before trying to create a walrus blob id.

i.e.

❯ ./target/release/site-builder --config site-builder/assets/builder-example.yaml publish examples/snake/

...
Parsing the directory examples/snake/ and locally computing blob IDs ...
Error during execution
Error: error while reading resource `examples/snake/empty.txt`

Caused by:
    0: Walrus sites does not support empty files.
    1: The file examples/snake/empty.txt is empty.
vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
walrus-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 19, 2024 9:26am
Tzal3x commented 1 month ago

Thanks again @Tzal3x ! sorry for the pedantic nit 😬

Any feedback is always valuable 😁