v2: stage 2 for enhancing 'v version' with the current git commit hash
parent
01aa2b86f5
commit
4ada412a05
|
@ -20,12 +20,7 @@ pub fn vhash() string {
|
||||||
pub fn full_hash() string {
|
pub fn full_hash() string {
|
||||||
build_hash := vhash()
|
build_hash := vhash()
|
||||||
current_hash := githash(false)
|
current_hash := githash(false)
|
||||||
final_hash := if build_hash == current_hash {
|
return '${build_hash}.${current_hash}'
|
||||||
build_hash
|
|
||||||
} else {
|
|
||||||
'${build_hash}.${current_hash}'
|
|
||||||
}
|
|
||||||
return final_hash
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// full_v_version() returns the full version of the V compiler
|
// full_v_version() returns the full version of the V compiler
|
||||||
|
@ -75,10 +70,8 @@ pub fn githash(should_get_from_filesystem bool) string {
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// TODO: use C.V_CURRENT_COMMIT_HASH at stage 2, after v.c is regenerated
|
mut buf := [50]byte
|
||||||
// mut buf := [50]byte
|
buf[0] = 0
|
||||||
// buf[0] = 0
|
C.snprintf(charptr(buf), 50, '%s', C.V_CURRENT_COMMIT_HASH)
|
||||||
// C.snprintf(charptr(buf), 50, '%s', C.V_CURRENT_COMMIT_HASH)
|
return tos_clone(buf)
|
||||||
// return tos_clone(buf)
|
|
||||||
return 'unknown'
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue