🛰️ export from upstream (b301c15)
This commit is contained in:
@@ -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)?;
|
||||||
|
|||||||
@@ -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(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user