From 5698695bcf9112da9216ae3915303c8cdce2c6f5 Mon Sep 17 00:00:00 2001 From: Daniel Thom Date: Tue, 9 Mar 2021 16:08:42 -0700 Subject: [PATCH] Change the cp system command used for Windows In Julia 1.5.3 the invalid command was causing terminal display issues in Windows Cmd and PowerShell terminals. --- src/utils/utils.jl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/utils/utils.jl b/src/utils/utils.jl index 0b67051ac..6f916db82 100644 --- a/src/utils/utils.jl +++ b/src/utils/utils.jl @@ -383,14 +383,10 @@ get_type_from_strings(module_name, type) = getfield(get_module(module_name), Sym # This function is used instead of cp given # https://github.com/JuliaLang/julia/issues/30723 function copy_file(src::AbstractString, dst::AbstractString) - try + if Sys.iswindows() + run(`cmd /c copy /Y $(src) $(dst)`) + else run(`cp -f $(src) $(dst)`) - catch e - if Sys.iswindows() - run(`cmd /c copy /Y $(src) $(dst)`) - else - rethrow() - end end return end