mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
doctor: report the vmodules writability too
This commit is contained in:
parent
22ebbab462
commit
005676fe60
@ -110,17 +110,18 @@ fn (mut a App) collect_info() {
|
|||||||
command: 'cc --version'
|
command: 'cc --version'
|
||||||
}))
|
}))
|
||||||
a.println('')
|
a.println('')
|
||||||
a.line('getwd', os.getwd())
|
getwd := os.getwd()
|
||||||
|
vmodules := os.vmodules_dir()
|
||||||
vexe := os.getenv('VEXE')
|
vexe := os.getenv('VEXE')
|
||||||
vroot := os.dir(vexe)
|
vroot := os.dir(vexe)
|
||||||
os.chdir(vroot)
|
os.chdir(vroot)
|
||||||
|
a.line('getwd', getwd)
|
||||||
|
a.line('vmodules', vmodules)
|
||||||
a.line('vroot', vroot)
|
a.line('vroot', vroot)
|
||||||
a.line('vexe', vexe)
|
a.line('vexe', vexe)
|
||||||
a.line('vexe mtime', time.unix(os.file_last_mod_unix(vexe)).str())
|
a.line('vexe mtime', time.unix(os.file_last_mod_unix(vexe)).str())
|
||||||
is_writable_vroot := os.is_writable_folder(vroot) or {
|
a.line('is vroot writable', is_writable_dir(vroot).str())
|
||||||
false
|
a.line('is vmodules writable', is_writable_dir(vmodules).str())
|
||||||
}
|
|
||||||
a.line('is vroot writable', is_writable_vroot.str())
|
|
||||||
a.line('V full version', util.full_v_version(true))
|
a.line('V full version', util.full_v_version(true))
|
||||||
vtmp := os.getenv('VTMP')
|
vtmp := os.getenv('VTMP')
|
||||||
if vtmp != '' {
|
if vtmp != '' {
|
||||||
@ -279,6 +280,13 @@ fn (mut a App) report_info() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn is_writable_dir(path string) bool {
|
||||||
|
res := os.is_writable_folder(path) or {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
mut app := App{}
|
mut app := App{}
|
||||||
app.collect_info()
|
app.collect_info()
|
||||||
|
Loading…
Reference in New Issue
Block a user