Skip to content

Commit

Permalink
Allow specifying packages with . in their names
Browse files Browse the repository at this point in the history
this is done by internally replacing all the `.` with `-`.
  • Loading branch information
ayys committed Feb 12, 2024
1 parent dcf446e commit b09159f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/wasmer-pack/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,10 @@ fn parse_identifier(s: &str) -> Result<String, Error> {
);
anyhow::ensure!(
s.chars()
.all(|c| c.is_ascii_alphanumeric() || matches!(c, '-' | '_')),
"Identifiers can only contain '-', '_', ascii numbers, and letters"
.all(|c| c.is_ascii_alphanumeric() || matches!(c, '-' | '_' | '.')),
"Identifiers can only contain '-', '_', '.', ascii numbers, and letters"
);

Ok(s.to_string())
Ok(s.replace('.', "-"))
}

/// Information about the [`Package`] being generated.
Expand Down

0 comments on commit b09159f

Please sign in to comment.