Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kit"
authors = ["Sybil Technologies AG"]
version = "0.9.1"
version = "0.9.2"
edition = "2021"
description = "Development toolkit for Kinode"
homepage = "https://kinode.org"
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1019,20 +1019,20 @@ async fn make_app(current_dir: &std::ffi::OsString) -> Result<Command> {
.visible_alias("n")
.arg(Arg::new("DIR")
.action(ArgAction::Set)
.help("Path to create template directory at (must contain only a-z, A-Z, 0-9, `-`)")
.help("Path to create template directory at (must contain only a-z, 0-9, `-`)")
.required(true)
)
.arg(Arg::new("PACKAGE")
.action(ArgAction::Set)
.short('a')
.long("package")
.help("Name of the package (must contain only a-z, A-Z, 0-9, `-`) [default: DIR]")
.help("Name of the package (must contain only a-z, 0-9, `-`) [default: DIR]")
)
.arg(Arg::new("PUBLISHER")
.action(ArgAction::Set)
.short('u')
.long("publisher")
.help("Name of the publisher (must contain only a-z, A-Z, 0-9, `-`, `.`)")
.help("Name of the publisher (must contain only a-z, 0-9, `-`, `.`)")
.default_value("template.os")
)
.arg(Arg::new("LANGUAGE")
Expand Down
10 changes: 5 additions & 5 deletions src/new/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ fn replace_vars(

pub fn is_kimap_safe(input: &str, is_publisher: bool) -> bool {
let expression = if is_publisher {
r"^[a-zA-Z0-9\-.]+$"
r"^[a-z0-9\-.]+$"
} else {
r"^[a-zA-Z0-9\-]+$"
r"^[a-z0-9\-]+$"
};
let re = regex::Regex::new(expression).unwrap();
re.is_match(input)
Expand Down Expand Up @@ -283,12 +283,12 @@ pub fn execute(
if !is_kimap_safe(&package_name, false) {
let error = if !is_from_dir {
eyre!(
"`package_name` '{}' must be Kimap safe (a-z, A-Z, 0-9, - allowed).",
"`package_name` '{}' must be Kimap safe (a-z, 0-9, - allowed).",
package_name
)
} else {
eyre!(
"`package_name` (derived from given directory {:?}) '{}' must be Kimap safe (a-z, A-Z, 0-9, - allowed).",
"`package_name` (derived from given directory {:?}) '{}' must be Kimap safe (a-z, 0-9, - allowed).",
new_dir,
package_name,
)
Expand All @@ -297,7 +297,7 @@ pub fn execute(
}
if !is_kimap_safe(&publisher, true) {
return Err(eyre!(
"`publisher` '{}' must be Kimap safe (a-z, A-Z, 0-9, -, . allowed).",
"`publisher` '{}' must be Kimap safe (a-z, 0-9, -, . allowed).",
publisher
));
}
Expand Down
6 changes: 4 additions & 2 deletions src/start_package/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ fn check_manifest(pkg_dir: &Path, manifest_file_name: &str) -> Result<()> {
)
})?;
if !is_kimap_safe(file_name, false) {
return Err(eyre!("{manifest_json} file name '{file_name}' must be Kimap safe (a-z, A-Z, 0-9, - allowed)"));
return Err(eyre!(
"{manifest_json} file name '{file_name}' must be Kimap safe (a-z, 0-9, - allowed)"
));
}
if !is_kimap_safe(file_path, false) {
return Err(eyre!(
"{manifest_json} file path {:?} must be Kimap safe (a-z, A-Z, 0-9, - allowed)",
"{manifest_json} file path {:?} must be Kimap safe (a-z, 0-9, - allowed)",
entry.process_wasm_path,
));
}
Expand Down
Loading