use a temp directory for the hot reloading pipe on desktop, fullstack and liveview

This commit is contained in:
Evan Almloff committed 2023-12-06 17:01:51 -06:00
1 parent 8530f53692
commit b965fc23e9
3 files changed
+9 -6

No files matched your search

+3 -2
View File
@@ -109,7 +109,8 @@ pub async fn serve(config: CrateConfig, hot_reload_state: Option<HotReloadState>
}
async fn start_desktop_hot_reload(hot_reload_state: HotReloadState) -> Result<()> {
match LocalSocketListener::bind("@dioxusin") {
let path = std::env::temp_dir().join("dioxusin");
match LocalSocketListener::bind(path) {
Ok(local_socket_stream) => {
let aborted = Arc::new(Mutex::new(false));
// States
@@ -188,7 +189,7 @@ fn clear_paths() {
// We check if the file socket is already open from an old session and then delete it
let paths = ["./dioxusin", "./@dioxusin"];
for path in paths {
let path = std::path::PathBuf::from(path);
let path = std::env::temp_dir().join(path);
if path.exists() {
let _ = std::fs::remove_file(path);
}