Skip to content

Commit 2244970

Browse files
authored
Merge pull request #2 from WilliButz/fix-self-referencing-symlink
rust: fix self-referencing symlink by targeting parent directory instead
2 parents ec3c0ed + 2181019 commit 2244970

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rust/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ fn generator_symlink(
135135
fs::create_dir_all(&dir).with_context(|| format!("Failed to create {dir}"))?;
136136

137137
let symlink = format!("{dir}/{src_unit}");
138-
std::os::unix::fs::symlink(src_unit, &symlink)
138+
let link_target = format!("../{src_unit}");
139+
std::os::unix::fs::symlink(link_target, &symlink)
139140
.with_context(|| format!("Failed to create symlink {symlink}"))?;
140141

141142
Ok(())

0 commit comments

Comments
 (0)