MCPcopy Create free account
hub / github.com/adeljck/PassGet / GetInstallPath

Function GetInstallPath

modules/finalshell/finalshell.go:22–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22func GetInstallPath() string {
23 WorkDir := ""
24 for _, dir := range utils.WindowsDirs {
25 files, _, err := utils.ListFilesAndDirs(dir)
26 if err != nil {
27 continue
28 }
29 for _, file := range files {
30 if strings.Contains(file, "FinalShell.lnk") {
31 f, _ := lnk.File(file)
32 WorkDir = f.StringData.WorkingDir
33 break
34 }
35 }
36 if WorkDir != "" {
37 break
38 }
39 }
40 if WorkDir == "" {
41 log.Println("Can not get install path")
42 }
43 return WorkDir
44}
45func GetClientConfig(Path string) *ClientConfig {
46 ConfigFilepath := Path + `\config.json`
47 data, err := os.ReadFile(ConfigFilepath)

Callers 1

GetFunction · 0.85

Calls 1

ListFilesAndDirsFunction · 0.92

Tested by

no test coverage detected