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

repl: moved as a tool and using readline

This commit is contained in:
Henrixounez
2019-10-31 17:01:04 +01:00
committed by Alexander Medvednikov
parent 114953f28d
commit 55f6e810cf
4 changed files with 82 additions and 47 deletions

View File

@ -1048,6 +1048,23 @@ pub fn install_v(args[]string) {
}
}
pub fn run_repl() {
vexec := vexe_path()
vroot := os.dir(vexec)
vrepl := '$vroot/tools/vrepl'
os.chdir(vroot + '/tools')
vrepl_compilation := os.exec('"$vexec" -o $vrepl vrepl.v') or {
verror(err)
return
}
if vrepl_compilation.exit_code != 0 {
verror(vrepl_compilation.output)
return
}
vreplresult := os.system('$vrepl "$vexec"')
}
pub fn create_symlink() {
vexe := vexe_path()
link_path := '/usr/local/bin/v'