Skip to content

Commit

Permalink
BUG: ensure directory exists before moving
Browse files Browse the repository at this point in the history
  • Loading branch information
jungheejung committed Aug 21, 2024
1 parent 7bcd345 commit 1cd7481
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def c1_process_temp_files(sub, ses, task, run, repo2task_dict):
destination = f"/home/spacetop/repos/data/{sub}/{task}/{ses}/{sub}_{ses}_{task}_{run}_beh_TEMP.csv"
else:
destination = f"/home/spacetop/repos/data/{sub}/{task}/{sub}_{ses}_{task}_{run}_beh_TEMP.csv"


destination_dir = Path(destination).parent
destination_dir.mkdir(parents=True, exist_ok=True)
subprocess.run(["cp", file, destination])
print(destination)
os.chdir("/home/spacetop/repos/data")
Expand Down

0 comments on commit 1cd7481

Please sign in to comment.