aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authornotgne22020-11-29 11:51:52 -0700
committernotgne22020-11-29 11:51:52 -0700
commitfa4c0a86cd608f5e98b50e8eb4b03db04a7726ce (patch)
tree2b9fead1176af0009a11ab1f6fd8e3c3c83f5093 /src/main.rs
parenta19af74789c73601871df4c1fa46d223270d0575 (diff)
Use crude Nix parsing for parsing the flake path
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 544f563..be7ad40 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -338,7 +338,7 @@ async fn run_deploy(
extra_build_args: &[String],
) -> Result<(), RunDeployError> {
let to_deploy: Vec<((&str, &utils::data::Node), (&str, &utils::data::Profile))> =
- match (deploy_flake.node, deploy_flake.profile) {
+ match (&deploy_flake.node, &deploy_flake.profile) {
(Some(node_name), Some(profile_name)) => {
let node = match data.nodes.get(node_name) {
Some(x) => x,
@@ -379,7 +379,7 @@ async fn run_deploy(
profiles_list
.into_iter()
- .map(|x| ((node_name, node), x))
+ .map(|x| ((node_name.as_str(), node), x))
.collect()
}
(None, None) => {
@@ -424,7 +424,7 @@ async fn run_deploy(
let mut parts: Vec<(utils::DeployData, utils::DeployDefs)> = Vec::new();
- for ((node_name, node), (profile_name, profile)) in &to_deploy {
+ for ((node_name, node), (profile_name, profile)) in to_deploy {
let deploy_data = utils::make_deploy_data(
&data.generic_settings,
node,
@@ -478,6 +478,8 @@ enum RunError {
CheckDeploymentError(#[from] CheckDeploymentError),
#[error("Failed to evaluate deployment data: {0}")]
GetDeploymentDataError(#[from] GetDeploymentDataError),
+ #[error("Error parsing flake: {0}")]
+ ParseFlakeError(#[from] utils::ParseFlakeError),
#[error("{0}")]
RunDeployError(#[from] RunDeployError),
}
@@ -491,7 +493,7 @@ async fn run() -> Result<(), RunError> {
let opts: Opts = Opts::parse();
- let deploy_flake = utils::parse_flake(opts.flake.as_str());
+ let deploy_flake = utils::parse_flake(opts.flake.as_str())?;
let cmd_overrides = utils::CmdOverrides {
ssh_user: opts.ssh_user,