mirror of
https://github.com/vlang/v.git
synced 2025-09-15 23:42:28 +03:00
compiler: cached modules - windows fixes & organise cached module path (#2302)
compiler: cached modules - windows fixes & organise cached module path (#2302)
This commit is contained in:
parent
dd053d79b0
commit
40156392f8
6 changed files with 41 additions and 39 deletions
|
@ -107,17 +107,15 @@ fn v_type_str(typ_ string) string {
|
|||
fn (v &V) generate_vh() {
|
||||
println('\n\n\n\nGenerating a V header file for module `$v.mod`')
|
||||
mod_path := v.mod.replace('.', os.PathSeparator)
|
||||
dir := '$v_modules_path${os.PathSeparator}$mod_path'
|
||||
dir := if v.dir.starts_with('vlib') {
|
||||
'$v_modules_path${os.PathSeparator}$v.dir'
|
||||
} else {
|
||||
'$v_modules_path${os.PathSeparator}$mod_path'
|
||||
}
|
||||
path := dir + '.vh'
|
||||
if !os.dir_exists(dir) {
|
||||
// create recursive
|
||||
mut mkpath := v_modules_path
|
||||
for subdir in mod_path.split(os.PathSeparator) {
|
||||
mkpath += os.PathSeparator + subdir
|
||||
if !os.dir_exists(mkpath) {
|
||||
os.mkdir(mkpath)
|
||||
}
|
||||
}
|
||||
pdir := dir.all_before_last(os.PathSeparator)
|
||||
if !os.dir_exists(pdir) {
|
||||
os.mkdir_all(pdir)
|
||||
// os.mkdir(os.realpath(dir))
|
||||
}
|
||||
file := os.create(path) or { panic(err) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue