Skip to content

Commit 0e4ba66

Browse files
committed
fix: 🚑 fail to create task_logs folder
1 parent 90b1524 commit 0e4ba66

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.github/icon-logo-h64.ai

37.1 KB
Binary file not shown.

src/kurv/stdio.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ pub fn create_log_file_handles(
1919
task_name: &str,
2020
path: &Path,
2121
) -> Result<((PathBuf, File), (PathBuf, File))> {
22-
// create path if it doesn't exist
23-
create_dir_all(path)?;
24-
2522
let (stdout_path, stderr_path) = get_log_paths(task_name, path);
2623
let stdout_handle = create_or_append_file(&stdout_path)?;
2724
let stderr_handle = create_or_append_file(&stderr_path)?;
@@ -31,6 +28,10 @@ pub fn create_log_file_handles(
3128

3229
/// creates a file or opens it for appending if it already exists
3330
fn create_or_append_file(path: &Path) -> Result<File> {
31+
if let Some(parent) = path.parent() {
32+
create_dir_all(parent).map_err(|err| anyhow!("failed to create directories: {}", err))?;
33+
}
34+
3435
OpenOptions::new()
3536
.create(true)
3637
.append(true)

src/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ use {
2222
fn main() -> Result<()> {
2323
Logger::init(Level::Trace)?;
2424

25-
26-
2725
match dispatch_command()? {
2826
DispatchResult::Dispatched => Ok(()),
2927
DispatchResult::Server => {

🧺 kurv.code-workspace

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"PATH": "${workspaceFolder}/target/debug;${env:PATH}",
1111
"KURV_SERVER": "true",
1212
"KURV_HOME": "${workspaceFolder}"
13+
},
14+
"lucodear-icons.files.associations": {
15+
"*.task_logs/stdout": "log",
16+
"*.task_logs/stderr": "log",
1317
}
1418
}
1519
}

0 commit comments

Comments
 (0)