Compare commits
1 Commits
0ed045d73e
...
0d120588dc
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d120588dc |
@@ -53,8 +53,9 @@ impl Server {
|
|||||||
fs::create_dir_all(path).with_context(|| "creating directory")?;
|
fs::create_dir_all(path).with_context(|| "creating directory")?;
|
||||||
self.rewriter.rewrite_folder(&self.template_dir, path).with_context(|| "generating configs")?;
|
self.rewriter.rewrite_folder(&self.template_dir, path).with_context(|| "generating configs")?;
|
||||||
// Finally, symlink it to the output folder; only support Linux for now
|
// Finally, symlink it to the output folder; only support Linux for now
|
||||||
fs::remove_file(&self.config_dir).with_context(|| "removing old symlink")?;
|
let symlink = Path::new(&self.workspace_dir).join("symlink.tmp");
|
||||||
std::os::unix::fs::symlink(path, &self.config_dir).with_context(|| "updating symlink")?;
|
std::os::unix::fs::symlink(path, &symlink).with_context(|| "creating symlink")?;
|
||||||
|
fs::rename(symlink, &self.config_dir).with_context(|| "renaming symlink")?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user