Skip to content

Commit 7cb5498

Browse files
committed
fix(GetStateFolder): put files in specific state folder
1 parent d22962f commit 7cb5498

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/cmd/cmd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var (
1616
spicetifyFolder = utils.GetSpicetifyFolder()
1717
rawFolder, themedFolder = getExtractFolder()
1818
backupFolder = utils.GetStateFolder("Backup")
19-
userThemesFolder = utils.GetUserFolder("Themes")
19+
userThemesFolder = utils.GetSubFolder(spicetifyFolder, "Themes")
2020
quiet bool
2121
isAppX = false
2222
spotifyPath string

src/utils/path-utils.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,21 @@ func GetStateFolder(name string) string {
9292

9393
result = filepath.Join(parent, "spicetify")
9494
}
95-
return result
95+
96+
return GetSubFolder(result, name)
9697
}
9798

98-
// getUserFolder checks if folder `name` is available in spicetifyFolder,
99+
// GetSubFolder checks if folder `name` is available in specified folder,
99100
// else creates then returns the path.
100-
func GetUserFolder(name string) string {
101-
dir := filepath.Join(GetSpicetifyFolder(), name)
101+
func GetSubFolder(folder string, name string) string {
102+
dir := filepath.Join(folder, name)
102103
CheckExistAndCreate(dir)
103104

104105
return dir
105106
}
106107

107-
var userAppsFolder = GetUserFolder("CustomApps")
108-
var userExtensionsFolder = GetUserFolder("Extensions")
108+
var userAppsFolder = GetSubFolder(GetSpicetifyFolder(), "CustomApps")
109+
var userExtensionsFolder = GetSubFolder(GetSpicetifyFolder(), "Extensions")
109110

110111
func GetCustomAppSubfolderPath(folderPath string) string {
111112
entries, err := os.ReadDir(folderPath)

0 commit comments

Comments
 (0)