From 05beb1c621a2d3931b47b7d09dd1114cd96a4bb7 Mon Sep 17 00:00:00 2001 From: sriharshakandala Date: Wed, 13 Nov 2024 13:59:56 -0800 Subject: [PATCH] Replace `Base.cp` with run(...) on non-Windows operating systems. `Base.cp` seems to have a bug when copying large files. Using `run` fixes this behaviour. This fixes the bug mentioned in https://github.com/CliMA/ClimaArtifacts/pull/64 --- ClimaArtifactsHelper.jl/src/ClimaArtifactsHelper.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ClimaArtifactsHelper.jl/src/ClimaArtifactsHelper.jl b/ClimaArtifactsHelper.jl/src/ClimaArtifactsHelper.jl index 1ac2d76..6e23451 100644 --- a/ClimaArtifactsHelper.jl/src/ClimaArtifactsHelper.jl +++ b/ClimaArtifactsHelper.jl/src/ClimaArtifactsHelper.jl @@ -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