MCPcopy
hub / github.com/spicetify/cli / Auto

Function Auto

src/cmd/auto.go:12–36  ·  view source on GitHub ↗

Auto checks Spotify state, re-backup and apply if needed, then launch Spotify client normally.

(spicetifyVersion string)

Source from the content-addressed store, hash-verified

10// Auto checks Spotify state, re-backup and apply if needed, then launch
11// Spotify client normally.
12func Auto(spicetifyVersion string) {
13 backupVersion := backupSection.Key("version").MustString("")
14 spotStat := spotifystatus.Get(appPath)
15 backStat := backupstatus.Get(prefsPath, backupFolder, backupVersion)
16
17 if spotStat.IsBackupable() && (backStat.IsEmpty() || backStat.IsOutdated()) {
18 Backup(spicetifyVersion, true)
19 backupVersion := backupSection.Key("version").MustString("")
20 backStat = backupstatus.Get(prefsPath, backupFolder, backupVersion)
21 }
22
23 if !backStat.IsBackuped() {
24 os.Exit(1)
25 }
26
27 if isAppX {
28 spotStat = spotifystatus.Get(appDestPath)
29 }
30
31 if !spotStat.IsApplied() && backStat.IsBackuped() {
32 CheckStates()
33 InitSetting()
34 Apply(spicetifyVersion)
35 }
36}

Callers 1

mainFunction · 0.92

Calls 9

BackupFunction · 0.85
CheckStatesFunction · 0.85
InitSettingFunction · 0.85
ApplyFunction · 0.85
IsBackupableMethod · 0.65
IsEmptyMethod · 0.65
IsOutdatedMethod · 0.65
IsBackupedMethod · 0.65
IsAppliedMethod · 0.65

Tested by

no test coverage detected