File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -184,10 +184,18 @@ fn vpm_install_from_vcs(modules []string, vcs &VCS) {
184184 if os.exists (minfo.final_module_path) {
185185 eprintln ('Warning module "${minfo.final_module_path} " already exists!' )
186186 eprintln ('Removing module "${minfo.final_module_path} " ...' )
187- os.rmdir_all (minfo.final_module_path) or {
187+ mut err_msg := ''
188+ $if windows {
189+ os.execute_opt ('rd /s /q ${minfo.final_module_path} ' ) or {
190+ err_msg = err.msg ()
191+ }
192+ } $else {
193+ os.rmdir_all (minfo.final_module_path) or { err_msg = err.msg () }
194+ }
195+ if err_msg != '' {
188196 errors++
189197 eprintln ('Errors while removing "${minfo.final_module_path} " :' )
190- eprintln (err )
198+ eprintln (err_msg )
191199 continue
192200 }
193201 }
Original file line number Diff line number Diff line change @@ -52,11 +52,6 @@ fn test_install_from_git_url() {
5252}
5353
5454fn test_install_already_existent () {
55- // FIXME: Skip this for now on Windows, as `rmdir_all` results in permission
56- // errors when vpm tries to remove existing modules.
57- $if windows {
58- return
59- }
6055 mut res := os.execute ('${v} install https://github.com/vlang/markdown' )
6156 assert res.exit_code == 0 , res.output
6257 assert res.output.contains ('already exists' )
You can’t perform that action at this time.
0 commit comments