Skip to content

Commit

Permalink
fix(cli/core/dev): ensure distDir exists (#1228)
Browse files Browse the repository at this point in the history
__tauri.js could be written to a nonextistent dir otherwise
  • Loading branch information
nklayman committed Feb 13, 2021
1 parent ae76c60 commit 4db2196
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cli/core/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use shared_child::SharedChild;
use std::{
env::{set_current_dir, set_var},
ffi::OsStr,
fs::File,
fs::{create_dir_all, File},
io::Write,
path::PathBuf,
process::{exit, Command},
Expand Down Expand Up @@ -117,7 +117,9 @@ impl Dev {
let tauri_script = TauriScript::new()
.global_tauri(config_.build.with_global_tauri)
.get();
let tauri_script_path = PathBuf::from(&config_.build.dist_dir).join("__tauri.js");
let tauri_dir_path = PathBuf::from(&config_.build.dist_dir);
let tauri_script_path = tauri_dir_path.join("__tauri.js");
create_dir_all(tauri_dir_path)?;
let mut tauri_script_file = File::create(tauri_script_path)?;
tauri_script_file.write_all(tauri_script.as_bytes())?;
}
Expand Down

0 comments on commit 4db2196

Please sign in to comment.