-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeremy Moeglich
committed
Oct 7, 2024
1 parent
c2114e8
commit 9cf2eee
Showing
16 changed files
with
352 additions
and
208 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ use weaveconfig::generate_weaveconfig; | |
|
||
#[derive(Parser)] | ||
#[command( | ||
name = "weaveconfig-cli", | ||
version = "0.1.2", | ||
name = "weaveconfig", | ||
version = "0.1.3", | ||
author = "Jeremy Moeglich <[email protected]>", | ||
about = "A CLI to manage weaveconfig configurations" | ||
)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use serde_json::{Map, Value}; | ||
|
||
use crate::template_file::value_type; | ||
|
||
pub fn get_environment_value( | ||
variables: &Map<String, Value>, | ||
environment: &str, | ||
) -> Result<Map<String, Value>, anyhow::Error> { | ||
let environment_variables = variables.get(environment).ok_or(anyhow::anyhow!( | ||
"Environment {} not found in variables, this is an internal error", | ||
environment | ||
))?; | ||
let mut variables = variables.clone(); | ||
if let Value::Object(environment_variables) = environment_variables { | ||
for (key, value) in environment_variables { | ||
variables.insert(key.clone(), value.clone()); | ||
} | ||
return Ok(variables); | ||
} | ||
Err(anyhow::anyhow!( | ||
"Expected an object, got {}", | ||
value_type(environment_variables) | ||
)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.