1
0
mirror of https://github.com/ManyakRus/starter.git synced 2025-11-26 23:10:42 +02:00

ProgramDir()

This commit is contained in:
Sanek
2023-05-27 19:26:23 +03:00
parent 53f4efc185
commit 0f26ce5ed8

View File

@@ -218,6 +218,23 @@ func ProgramDir_Common() string {
}
}
substr = "\\temp\\"
pos1 = strings.Index(sdir, substr)
if pos1 >= 0 {
filename = CurrentFilename()
dir = filepath.Dir(filename)
substr := SeparatorFile() + "vendor" + SeparatorFile()
pos_vendor := strings.Index(strings.ToLower(dir), substr)
if pos_vendor >= 0 {
dir = dir[0:pos_vendor]
} else if dir[len(dir)-5:] == "micro" {
dir = FindDirUp(dir)
//dir = FindDirUp(dir)
//dir = FindDirUp(dir)
}
}
//dir, err := os.Getwd()
//if err != nil {
// log.Fatalln(err)