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

Function Extract

src/backup/backup.go:16–34  ·  view source on GitHub ↗

Extract all SPA files from backupPath to extractPath

(backupPath, extractPath string)

Source from the content-addressed store, hash-verified

14
15// Extract all SPA files from backupPath to extractPath
16func Extract(backupPath, extractPath string) {
17 spinner, _ := utils.Spinner.Start("Extracting backup")
18 for _, app := range []string{"xpui", "login"} {
19 appPath := filepath.Join(backupPath, app+".spa")
20 appExtractToFolder := filepath.Join(extractPath, app)
21
22 _, err := os.Stat(appPath)
23 if err != nil {
24 continue
25 }
26
27 err = utils.Unzip(appPath, appExtractToFolder)
28 if err != nil {
29 spinner.Fail("Failed to extract backup")
30 utils.Fatal(err)
31 }
32 }
33 spinner.Success("Extracted backup")
34}

Callers

nothing calls this directly

Calls 2

UnzipFunction · 0.92
FatalFunction · 0.92

Tested by

no test coverage detected