@@ -55,7 +55,7 @@ defmodule Mix.Tasks.Archive.Install do
55
55
remove_previous_versions ( previous )
56
56
57
57
archive = Path . join ( Mix.Local . archives_path ( ) , basename ( src ) )
58
- check_file_exists ( archive )
58
+ check_file_exists ( src , archive )
59
59
60
60
if Mix.Utils . copy_path! ( src , archive , opts ) do
61
61
Mix . shell . info [ :green , "* creating " , :reset , Path . relative_to_cwd ( archive ) ]
@@ -83,15 +83,18 @@ defmodule Mix.Tasks.Archive.Install do
83
83
"Are you sure you want to replace them?" )
84
84
end
85
85
86
- defp check_file_exists ( path ) do
86
+ defp check_file_exists ( src , path ) do
87
87
# OTP keeps loaded archives open, this leads to unfortunate behaviour on
88
88
# Windows when trying overwrite loaded archives. remove_previous_versions
89
89
# completes successfully even though the file will be first removed after
90
90
# the BEAM process is dead. Because of this we ask the user rerun the
91
91
# command, which should complete successfully at that time
92
92
93
93
if File . exists? ( path ) and match? ( { :win32 , _ } , :os . type ) do
94
- Mix . raise "Unable to overwrite open archives on Windows. Run the command again"
94
+ Mix . raise "Unable to overwrite open archives on Windows. Please manually remove " <>
95
+ "the existing archive at #{ inspect path } and run this command again. In " <>
96
+ "case re-running the command still does not work, please fetch the archive " <>
97
+ "at #{ inspect src } and manually copy it to #{ inspect path } ."
95
98
end
96
99
end
97
100
0 commit comments