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 docs/CommandLineHelp.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ Runs Edge App emulator
###### **Options:**

* `-p`, `--path <PATH>` — Path to the directory with the manifest. If not specified CLI will use the current working directory
* `-s`, `--secrets <SECRETS>`
* `-s`, `--secrets <SECRETS>` — Secrets to be passed to the Edge App in the form KEY=VALUE. Can be specified multiple times
* `-g`, `--generate-mock-data` — Generates mock data to be used with Edge App run


Expand Down
1 change: 1 addition & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ pub enum EdgeAppCommands {
#[arg(short, long)]
path: Option<String>,

/// Secrets to be passed to the Edge App in the form KEY=VALUE. Can be specified multiple times.
#[arg(short, long, value_parser = parse_key_values::<Secrets>)]
secrets: Option<Secrets>,

Expand Down
5 changes: 1 addition & 4 deletions src/commands/edge_app/setting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ impl EdgeAppCommand {
setting_key: &str,
setting_value: &str,
) -> Result<(), CommandError> {
let installation_id = match self.get_installation_id(path.clone()) {
Ok(id) => Some(id),
Err(_) => None,
};
let installation_id = self.get_installation_id(path.clone()).ok();
let actual_installation_id = match installation_id {
Some(id) => id.clone(),
None => "".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion src/commands/edge_app/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ mod tests {
}

#[test]
fn test_transform_edge_app_path_to_manifest_when_path_provided_should_return_path_with_instance_manifest(
fn test_transform_edge_app_path_to_manifest_when_path_provided_should_return_path_with_manifest(
) {
let dir = tempdir().unwrap();
let dir_path = dir.path();
Expand Down
5 changes: 4 additions & 1 deletion src/commands/serde_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,8 @@ where
}

pub fn string_field_is_none_or_empty(opt: &Option<String>) -> bool {
opt.as_ref().map_or(true, |s| s.is_empty())
match opt.as_ref() {
None => true,
Some(s) => s.is_empty(),
}
}
Loading