diff --git a/backend/parsers/windmill-parser-bash/src/lib.rs b/backend/parsers/windmill-parser-bash/src/lib.rs index 6e9b5a4eed..23e4c0ef24 100644 --- a/backend/parsers/windmill-parser-bash/src/lib.rs +++ b/backend/parsers/windmill-parser-bash/src/lib.rs @@ -18,7 +18,7 @@ pub fn parse_bash_sig(code: &str) -> anyhow::Result { } lazy_static::lazy_static! { - static ref RE: Regex = Regex::new(r#"(?m)^(\w+)="\$(?:(\d+)|\{(\d+):-(.*)\})"$"#).unwrap(); + static ref RE: Regex = Regex::new(r#"(?m)^(\w+)="\$(?:(\d+)|\{(\d+):-(.*)\})"(?:([\t ]*#.*)?)$"#).unwrap(); } fn parse_file(code: &str) -> anyhow::Result>> { @@ -66,6 +66,7 @@ mod tests { token="$1" image="$2" digest="${3:-latest with spaces}" +text="$4" # with comment "#; //println!("{}", serde_json::to_string()?); @@ -95,6 +96,13 @@ digest="${3:-latest with spaces}" typ: Typ::Str(None), default: Some(json!("latest with spaces")), has_default: false + }, + Arg { + otyp: None, + name: "text".to_string(), + typ: Typ::Str(None), + default: None, + has_default: false } ] }