Skip to content

Commit

Permalink
Replace Base.cp with run(...) on non-Windows operating systems.
Browse files Browse the repository at this point in the history
`Base.cp` seems to have a bug when copying large files. Using `run` fixes this behaviour.
This fixes the bug mentioned in #64
  • Loading branch information
sriharshakandala committed Nov 13, 2024
1 parent 52fec71 commit 05beb1c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ClimaArtifactsHelper.jl/src/ClimaArtifactsHelper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ function create_artifact_guided_one_file(
Base.mv(downloaded_file, file_path)
end

Base.cp(file_path, joinpath(output_dir, basename(file_path)))
if Sys.iswindows()
Base.cp(file_path, joinpath(output_dir, basename(file_path)))
else
run(`cp $file_path $(joinpath(output_dir, basename(file_path)))`)
end

create_artifact_guided(output_dir; artifact_name, append)
end
Expand Down

0 comments on commit 05beb1c

Please sign in to comment.