spinframework / spinframework/spin
`files` manifest option should warn when `destination` does not appear to be a directory
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
Given the following manifest configuration:
files = [{ source = "static/foo.txt", destination = "bar.txt" }]
I would expect at least a warning as I believe destination must always be a directory. If source is a file, that file will be located inside the destination directory, and if source is a directory, all the files will be available at destination. I imagine we can't always error because paths that look like file names are still legal directory names (i.e., "foo.txt" can be a directory name), but we can at least issue a warning as this is more than likely a bug.
Edit: it seems that destinations as files are allowed, but this will break in very weird ways if source is a directory and not a file.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in crates/loader/src/local.rs around the destination handling referenced in the issue, then reproduce the manifest with a file source and a directory source. Confirm how a destination that looks like a filename is handled and add coverage for the requested warning; done means the directory case warns without rejecting legal directory names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100