build.rs: don't fail on symlink creation

This commit is contained in:
Oystein Kristoffer Tveit 2024-08-07 16:19:40 +02:00
parent 05c15da59d
commit 404e5371e3
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
1 changed files with 7 additions and 3 deletions

View File

@ -17,20 +17,24 @@ fn main() -> anyhow::Result<()> {
.ok_or(anyhow!("Could not resolve target profile directory"))? .ok_or(anyhow!("Could not resolve target profile directory"))?
.to_path_buf(); .to_path_buf();
dbg!(&target_profile_dir); if !target_profile_dir.exists() {
std::fs::create_dir_all(&target_profile_dir)?;
}
if !target_profile_dir.join("mysql-useradm").exists() { if !target_profile_dir.join("mysql-useradm").exists() {
symlink( symlink(
target_profile_dir.join("mysqladm"), target_profile_dir.join("mysqladm"),
target_profile_dir.join("mysql-useradm"), target_profile_dir.join("mysql-useradm"),
)?; )
.ok();
} }
if !target_profile_dir.join("mysql-dbadm").exists() { if !target_profile_dir.join("mysql-dbadm").exists() {
symlink( symlink(
target_profile_dir.join("mysqladm"), target_profile_dir.join("mysqladm"),
target_profile_dir.join("mysql-dbadm"), target_profile_dir.join("mysql-dbadm"),
)?; )
.ok();
} }
} }