Skip to content

Commit

Permalink
change udmrepo config file location to tmp
Browse files Browse the repository at this point in the history
Signed-off-by: Lyndon-Li <[email protected]>
  • Loading branch information
Lyndon-Li committed Jan 13, 2025
1 parent 46b8a31 commit e79dbb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelogs/unreleased/8602-Lyndon-Li
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix issue #8067, add tmp folder (/tmp for linux, C:\Windows\Temp for Windows) as an alternative of udmrepo's config file location
7 changes: 6 additions & 1 deletion pkg/repository/udmrepo/repo_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ func GetRepoDomain() string {

func getRepoConfigFile(workPath string, repoID string) string {
if workPath == "" {
workPath = filepath.Join(os.Getenv("HOME"), "udmrepo")
home := os.Getenv("HOME")
if home != "" {
workPath = filepath.Join(home, "udmrepo")
} else {
workPath = filepath.Join(os.TempDir(), "udmrepo")
}

Check warning on line 208 in pkg/repository/udmrepo/repo_options.go

View check run for this annotation

Codecov / codecov/patch

pkg/repository/udmrepo/repo_options.go#L207-L208

Added lines #L207 - L208 were not covered by tests
}

name := "repo-" + strings.ToLower(repoID) + ".conf"
Expand Down

0 comments on commit e79dbb8

Please sign in to comment.