🛰️ export from upstream (b301c15)

This commit is contained in:
2026-09-22 11:15:47 +02:00
parent 387214612b
commit 5f8ec49fe8
2 changed files with 14 additions and 0 deletions
+11
View File
@@ -291,6 +291,7 @@ pub fn resolve_agent_home(sandcage_home: &Path, profile: Option<&str>) -> PathBu
eprintln!("sandcage: warning: failed to create home profile '{name}': {e}"); eprintln!("sandcage: warning: failed to create home profile '{name}': {e}");
} else { } else {
eprintln!("sandcage: created home profile '{name}'"); eprintln!("sandcage: created home profile '{name}'");
seed_zshrc(&agent_home);
} }
} }
@@ -301,6 +302,16 @@ pub fn resolve_agent_home(sandcage_home: &Path, profile: Option<&str>) -> PathBu
agent_home agent_home
} }
pub fn seed_zshrc(agent_home: &Path) {
let zshrc = agent_home.join(".zshrc");
if !zshrc.exists() {
let _ = std::fs::write(&zshrc, concat!(
"PROMPT='%F{blue}%~%f %# '\n",
"alias ls='ls --color=auto'\n",
));
}
}
fn migrate_legacy_home(legacy: &Path, homes_dir: &Path) -> std::result::Result<(), std::io::Error> { fn migrate_legacy_home(legacy: &Path, homes_dir: &Path) -> std::result::Result<(), std::io::Error> {
let default_dir = homes_dir.join("default"); let default_dir = homes_dir.join("default");
std::fs::create_dir_all(homes_dir)?; std::fs::create_dir_all(homes_dir)?;
+3
View File
@@ -77,6 +77,9 @@ pub fn preseed_with_home(home: &Path) -> Result<()> {
.map_err(|e| InitError::WriteFileFailed(justfile.clone(), e))?; .map_err(|e| InitError::WriteFileFailed(justfile.clone(), e))?;
} }
// 7. Seed .zshrc to suppress zsh-newuser-install wizard
crate::docker::seed_zshrc(&agent_home);
Ok(()) Ok(())
} }