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

tools: support cmd/tools/.disable_autorecompilation in v up and v self too

This commit is contained in:
Delyan Angelov
2021-01-18 09:33:33 +02:00
parent 2f82466d30
commit 17266ecb07
4 changed files with 49 additions and 4 deletions

View File

@@ -3,10 +3,12 @@ module main
import os
import os.cmdline
import v.pref
import v.util.recompilation
fn main() {
vexe := pref.vexe_path()
vroot := os.dir(vexe)
recompilation.must_be_enabled(vroot, 'Please install V from source, to use `v self` .')
os.chdir(vroot)
os.setenv('VCOLORS', 'always', true)
self_idx := os.args.index('self')

View File

@@ -3,6 +3,7 @@ module main
import os
import v.pref
import v.util
import v.util.recompilation
struct App {
is_verbose bool
@@ -12,15 +13,17 @@ struct App {
fn new_app() App {
vexe := os.real_path(pref.vexe_path())
vroot := os.dir(vexe)
return App{
is_verbose: '-v' in os.args
vexe: vexe
vroot: os.dir(vexe)
vroot: vroot
}
}
fn main() {
app := new_app()
recompilation.must_be_enabled(app.vroot, 'Please install V from source, to use `v up` .')
os.chdir(app.vroot)
println('Updating V...')
app.update_from_master()