Skip to content

Commit 7d905f8

Browse files
cx-hitesh-madgulkarcx-rahul-pidde
authored andcommitted
changed-file-path-to-download-vorpal-sca-resolver (#1344)
1 parent 9435b25 commit 7d905f8

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

internal/services/osinstaller/os-installer-structs.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,28 @@ type InstallationConfiguration struct {
1515
}
1616

1717
func (i *InstallationConfiguration) ExecutableFilePath() string {
18-
return filepath.Join(os.TempDir(), i.WorkingDirName, i.ExecutableFile)
18+
basePath := os.TempDir()
19+
homeDir, err := os.UserHomeDir()
20+
if err == nil {
21+
basePath = homeDir + "/.checkmarx/"
22+
}
23+
return filepath.Join(basePath, i.WorkingDirName, i.ExecutableFile)
1924
}
2025

2126
func (i *InstallationConfiguration) HashFilePath() string {
22-
return filepath.Join(os.TempDir(), i.WorkingDirName, i.HashFileName)
27+
basePath := os.TempDir()
28+
homeDir, err := os.UserHomeDir()
29+
if err == nil {
30+
basePath = homeDir + "/.checkmarx/"
31+
}
32+
return filepath.Join(basePath, i.WorkingDirName, i.HashFileName)
2333
}
2434

2535
func (i *InstallationConfiguration) WorkingDir() string {
26-
return filepath.Join(os.TempDir(), i.WorkingDirName)
36+
basePath := os.TempDir()
37+
homeDir, err := os.UserHomeDir()
38+
if err == nil {
39+
basePath = homeDir + "/.checkmarx/"
40+
}
41+
return filepath.Join(basePath, i.WorkingDirName)
2742
}

0 commit comments

Comments
 (0)