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

v2: enhance version with current git commit hash. Cleanup redundant code.

This commit is contained in:
Delyan Angelov
2020-04-02 14:31:02 +03:00
committed by GitHub
parent d9c7253836
commit 084f853a2a
7 changed files with 119 additions and 50 deletions

View File

@@ -9,6 +9,7 @@ import (
term
readline
os.cmdline
v.util
)
struct Repl {
@@ -63,8 +64,7 @@ fn (r &Repl) function_call(line string) bool {
}
pub fn repl_help() {
version := v_version()
println(version)
println(util.full_v_version())
println('
help Displays this information.
Ctrl-C, Ctrl-D, exit Exits the REPL.
@@ -73,8 +73,7 @@ pub fn repl_help() {
}
pub fn run_repl(workdir string, vrepl_prefix string) []string {
version := v_version()
println(version)
println(util.full_v_version())
println('Use Ctrl-C or `exit` to exit')
file := os.join_path(workdir, '.${vrepl_prefix}vrepl.v')
@@ -233,9 +232,3 @@ pub fn rerror(s string) {
os.flush()
exit(1)
}
fn v_version() string {
vexe := os.getenv('VEXE')
vversion_res := os.exec('$vexe -version') or { panic('"$vexe -version" is not working') }
return vversion_res.output
}