mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
tools: support v doctor -skip-github
to fully skip the fetching step, in places that have limited connectivity (alternative fix/workaround for #23955)
This commit is contained in:
parent
9a8961f9e6
commit
0893a72792
1 changed files with 3 additions and 1 deletions
|
@ -263,7 +263,9 @@ fn (mut a App) cpu_info(key string) string {
|
||||||
fn (mut a App) git_info() string {
|
fn (mut a App) git_info() string {
|
||||||
mut out := a.cmd(command: 'git -C . describe --abbrev=8 --dirty --always --tags').trim_space()
|
mut out := a.cmd(command: 'git -C . describe --abbrev=8 --dirty --always --tags').trim_space()
|
||||||
os.execute('git -C . remote add V_REPO https://github.com/vlang/v') // ignore failure (i.e. remote exists)
|
os.execute('git -C . remote add V_REPO https://github.com/vlang/v') // ignore failure (i.e. remote exists)
|
||||||
os.execute('${os.quoted_path(a.vexe)} timeout 5.1 "git -C . fetch V_REPO"') // usually takes ~0.6s; 5 seconds should be enough for even the slowest networks
|
if '-skip-github' !in os.args {
|
||||||
|
os.execute('${os.quoted_path(a.vexe)} timeout 5.1 "git -C . fetch V_REPO"') // usually takes ~0.6s; 5 seconds should be enough for even the slowest networks
|
||||||
|
}
|
||||||
commit_count := a.cmd(command: 'git rev-list @{0}...V_REPO/master --right-only --count').int()
|
commit_count := a.cmd(command: 'git rev-list @{0}...V_REPO/master --right-only --count').int()
|
||||||
if commit_count > 0 {
|
if commit_count > 0 {
|
||||||
out += ' (${commit_count} commit(s) behind V master)'
|
out += ' (${commit_count} commit(s) behind V master)'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue