Begin a streamed artifact upload to a unique temporary object.
(&self)
| 247 | if let Some(prefix) = &self.prefix { |
| 248 | path.strip_prefix(prefix.as_ref()) |
| 249 | .and_then(|rest| rest.strip_prefix('/')) |
| 250 | .unwrap_or(path) |
| 251 | } else { |
| 252 | path |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | /// Store the first immutable package revision under a stable slug identity. |
| 257 | pub async fn publish_mod(&self, input: &PublishModInput) -> Result<ModCatalogEntry> { |
| 258 | let slug = slugify(&input.name); |
| 259 | if slug.is_empty() { |
| 260 | bail!( |
| 261 | "mod name '{}' has no usable characters for an id", |
| 262 | input.name |
| 263 | ); |
| 264 | } |
| 265 | if input.file.is_empty() { |
| 266 | bail!("mod artifact is empty"); |
| 267 | } |
| 268 | if self.get_mod(&slug).await?.is_some() { |
no test coverage detected