pull/2514/head
Alexander Medvednikov 2019-10-23 15:55:14 +03:00
parent 6174dfb424
commit 1db1e0f4b7
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,7 @@ fn generate_vh(mod string) {
vexe := os.executable() vexe := os.executable()
full_mod_path := os.dir(vexe) + '/' + mod full_mod_path := os.dir(vexe) + '/' + mod
mod_path := mod.replace('.', os.path_separator) mod_path := mod.replace('.', os.path_separator)
dir := if mod.starts_with('vlib') { dir := if mod.starts_with('vlib') {
'$compiler.v_modules_path${os.path_separator}$mod' '$compiler.v_modules_path${os.path_separator}$mod'
@ -34,6 +35,9 @@ fn generate_vh(mod string) {
// os.mkdir(os.realpath(dir)) // os.mkdir(os.realpath(dir))
} }
out := os.create(path) or { panic(err) } out := os.create(path) or { panic(err) }
mod_def := if mod.contains('/') { mod.all_after('/') } else { mod } // "os"
out.writeln('// $mod module header \n')
out.writeln('module $mod_def\n')
// Consts // Consts
println(full_mod_path) println(full_mod_path)
mut vfiles := os.walk_ext(full_mod_path, '.v') mut vfiles := os.walk_ext(full_mod_path, '.v')