Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(#3201): changing folder location for folder Backup and Extracted #3282

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

UnaTried
Copy link

This was requested on issue #3201, I don't know how to test this, so I don't know if it will work. It should in theory though!

P.S: I am not a go-er I just made those changes, did go build and there was no ouput, so I assumed it worked, since it was throwing error whenever there was one.

Linux only version

func GetStateFolder(name string) string {
	result, isAvailable := os.LookupEnv("SPICETIFY_STATE")
	defer func() { CheckExistAndCreate(result) }()
		
	if isAvailable && len(result) > 0 {
		return result
	}

	if runtime.GOOS == "linux" {
		parent, isAvailable := os.LookupEnv("XDG_STATE_HOME")

		if !isAvailable || len(parent) == 0 {
			parent = filepath.Join(os.Getenv("HOME"), ".local", "state")
			CheckExistAndCreate(parent)
		}

		result = filepath.Join(parent, "spicetify")
	}
	return result
}

@UnaTried UnaTried changed the title Changing Folder location for folder Backup and Extracted refactor: Changing Folder location for folder Backup and Extracted Jan 26, 2025
@UnaTried UnaTried changed the title refactor: Changing Folder location for folder Backup and Extracted refactor: Changing Folder location for folder Backup and Extracted Jan 26, 2025
@UnaTried UnaTried changed the title refactor: Changing Folder location for folder Backup and Extracted refactor(#3201): Changing Folder location for folder Backup and Extracted Jan 26, 2025
@UnaTried UnaTried changed the title refactor(#3201): Changing Folder location for folder Backup and Extracted refactor(#3201): changing folder location for folder Backup and Extracted Jan 26, 2025
@UnaTried UnaTried changed the title refactor(#3201): changing folder location for folder Backup and Extracted refactor(#3201): changing folder location for folder Backup and Extracted Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant