1
0
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:
Delyan Angelov 2020-12-05 22:30:59 +02:00
parent 22ebbab462
commit 005676fe60
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -110,17 +110,18 @@ fn (mut a App) collect_info() {
command: 'cc --version'
}))
a.println('')
a.line('getwd', os.getwd())
getwd := os.getwd()
vmodules := os.vmodules_dir()
vexe := os.getenv('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('vexe', vexe)
a.line('vexe mtime', time.unix(os.file_last_mod_unix(vexe)).str())
is_writable_vroot := os.is_writable_folder(vroot) or {
false
}
a.line('is vroot writable', is_writable_vroot.str())
a.line('is vroot writable', is_writable_dir(vroot).str())
a.line('is vmodules writable', is_writable_dir(vmodules).str())
a.line('V full version', util.full_v_version(true))
vtmp := os.getenv('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() {
mut app := App{}
app.collect_info()