1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tools/oldv: fix default behaviour (regression caused by 760448a)

This commit is contained in:
Delyan Angelov 2020-01-27 17:56:32 +02:00 committed by Alexander Medvednikov
parent 31899eac2a
commit 7a79c94a9e
2 changed files with 13 additions and 3 deletions

View File

@ -39,6 +39,17 @@ pub fn chdir(path string) {
os.chdir(path) os.chdir(path)
} }
pub fn rmrf(path string) {
verbose_trace(@FN, 'rm -rf $path')
if os.exists(path) {
if os.is_dir(path) {
os.rmdir_recursive(path)
}else{
os.rm(path)
}
}
}
pub fn run(cmd string) string { pub fn run(cmd string) string {
verbose_trace(@FN, cmd) verbose_trace(@FN, cmd)
x := os.exec(cmd) or { x := os.exec(cmd) or {

View File

@ -1,6 +1,5 @@
import ( import (
os os
os.cmdline
flag flag
filepath filepath
scripting scripting
@ -100,8 +99,8 @@ fn main() {
context.cc = ecc context.cc = ecc
} }
if context.cleanup { if context.cleanup {
os.rmdir_recursive(context.path_v) scripting.rmrf(context.path_v)
os.rmdir_recursive(context.path_vc) scripting.rmrf(context.path_vc)
} }
context.compile_oldv_if_needed() context.compile_oldv_if_needed()