Chore: script built

This commit is contained in:
yaling888
2021-10-27 23:10:11 +08:00
parent ab12b440aa
commit 5a27df899f
13 changed files with 131 additions and 97 deletions

View File

@ -80,7 +80,7 @@ func (p *path) ScriptDir() string {
p.scriptDir = dir
} else {
p.scriptDir = P.Join(os.TempDir(), Name)
os.MkdirAll(p.scriptDir, 0o644)
_ = os.MkdirAll(p.scriptDir, 0o644)
}
return p.scriptDir
}
@ -92,3 +92,12 @@ func (p *path) Script() string {
func (p *path) GetAssetLocation(file string) string {
return P.Join(p.homeDir, file)
}
func (p *path) GetExecutableFullPath() string {
exePath, err := os.Executable()
if err != nil {
return "clash"
}
res, _ := filepath.EvalSymlinks(exePath)
return res
}