huskies: merge 1114 story new project: --path flag to override default host directory

This commit is contained in:
dave
2026-05-17 14:43:53 +00:00
parent 2d6846fe03
commit eb6b07531a
5 changed files with 78 additions and 7 deletions
+13
View File
@@ -33,6 +33,13 @@ pub struct ProjectEntry {
/// `ssh huskies@127.0.0.1 -p <ssh_port> -i ~/.huskies/<name>/id_ed25519`.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ssh_port: Option<u16>,
/// Absolute host path of the project directory (workspace bind-mount source).
///
/// Set by `new project` (story 1114). When `--path` is supplied the value
/// differs from the default `~/huskies/<name>/`. Stored here so that later
/// commands can route to the correct directory without re-deriving it.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub host_path: Option<String>,
}
impl ProjectEntry {
@@ -44,6 +51,7 @@ impl ProjectEntry {
url: Some(url.into()),
auth_token: None,
ssh_port: None,
host_path: None,
}
}
@@ -214,6 +222,7 @@ auth_token = "secret"
url: None,
auth_token: Some("secret".into()),
ssh_port: None,
host_path: None,
},
);
let config = GatewayConfig {
@@ -248,6 +257,7 @@ auth_token = "secret"
url: None,
auth_token: Some("tok".into()),
ssh_port: None,
host_path: None,
},
);
assert_eq!(validate_project_exists(&projects, "ws").unwrap(), "");
@@ -267,6 +277,7 @@ auth_token = "secret"
url: None,
auth_token: Some("tok".into()),
ssh_port: None,
host_path: None,
};
assert!(!e.has_url());
}
@@ -309,6 +320,7 @@ auth_token = "secret"
url: Some("http://a:3001".into()),
auth_token: Some("mysecret".into()),
ssh_port: None,
host_path: None,
};
let mut projects = BTreeMap::new();
projects.insert("myproj".into(), entry);
@@ -334,6 +346,7 @@ auth_token = "secret"
url: Some("http://127.0.0.1:3101".into()),
auth_token: None,
ssh_port: Some(2201),
host_path: None,
};
let mut projects = BTreeMap::new();
projects.insert("myproj".into(), entry);
+2
View File
@@ -748,6 +748,7 @@ mod tests {
url: None,
auth_token: Some("tok".into()),
ssh_port: None,
host_path: None,
},
);
let config = GatewayConfig {
@@ -887,6 +888,7 @@ mod tests {
url: Some("http://huskies:3001".into()),
auth_token: Some("secret-token".into()),
ssh_port: None,
host_path: None,
},
);
let config = GatewayConfig {