Skip to content

Commit

Permalink
Revert "Fix npm run dev failing because of missing log files when r…
Browse files Browse the repository at this point in the history
…un for the first time"

This reverts commit 8d66cac.
  • Loading branch information
Exidex committed Jan 19, 2025
1 parent 8d66cac commit 085b5ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 6 additions & 2 deletions rust/plugin_runtime/src/deno.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ pub async fn start_js_runtime(
let stdout = if let Some(stdout_file) = init.stdout_file {
let stdout_file = PathBuf::from(stdout_file);

let out_log_file = File::open(stdout_file)?;
std::fs::create_dir_all(stdout_file.parent().unwrap())?;

let out_log_file = File::create(stdout_file)?;

StdioPipe::file(out_log_file)
} else {
Expand All @@ -332,7 +334,9 @@ pub async fn start_js_runtime(
let stderr = if let Some(stderr_file) = init.stderr_file {
let stderr_file = PathBuf::from(stderr_file);

let err_log_file = File::open(stderr_file)?;
std::fs::create_dir_all(stderr_file.parent().unwrap())?;

let err_log_file = File::create(stderr_file)?;

StdioPipe::file(err_log_file)
} else {
Expand Down
6 changes: 0 additions & 6 deletions rust/server/src/plugins/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,11 @@ pub async fn start_plugin_runtime(data: PluginRuntimeData, run_status_guard: Run
let (stdout_file, stderr_file) = if dev_plugin {
let (stdout_file, stderr_file) = data.dirs.plugin_log_files(&plugin_uuid);

std::fs::create_dir_all(stdout_file.parent().unwrap())?;
File::create(&stdout_file)?;

let stdout_file = stdout_file
.to_str()
.context("non-uft8 paths are not supported")?
.to_string();

std::fs::create_dir_all(stderr_file.parent().unwrap())?;
File::create(&stderr_file)?;

let stderr_file = stderr_file.to_str()
.context("non-uft8 paths are not supported")?
.to_string();
Expand Down

0 comments on commit 085b5ce

Please sign in to comment.