Skip to content

Commit

Permalink
fix(cli): validate productName in config, closes #5233 (#5262)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir authored Sep 28, 2022
1 parent ae65951 commit b9316a6
Show file tree
Hide file tree
Showing 7 changed files with 574 additions and 125 deletions.
7 changes: 7 additions & 0 deletions .changes/cli-product-name-validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"cli.rs": "patch"
"tauri-utils": "patch"
---

Validate `pacakge > productName` in the tauri config and produce errors if it contains one of the following characters `/\:*?\"<>|`

1 change: 1 addition & 0 deletions core/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2585,6 +2585,7 @@ impl<'d> serde::Deserialize<'d> for PackageVersion {
pub struct PackageConfig {
/// App name.
#[serde(alias = "product-name")]
#[cfg_attr(feature = "schema", validate(regex(pattern = "^[^/\\:*?\"<>|]+$")))]
pub product_name: Option<String>,
/// App version. It is a semver version number or a path to a `package.json` file containing the `version` field.
#[serde(deserialize_with = "version_deserializer", default)]
Expand Down
Loading

0 comments on commit b9316a6

Please sign in to comment.