Installer/spm/utils.go
partisan 646851f9f8
All checks were successful
/ test-on-windows (push) Successful in 7s
/ test-on-alpine (push) Successful in 4s
added SPM
2024-12-25 08:46:25 +01:00

20 lines
326 B
Go

package spm
import (
"os"
)
func GetTempDownloadDir() string {
dir, err := os.MkdirTemp("", "spm_downloads")
if err != nil {
panic(err)
}
return dir
}
func SetDownloadFolder(customDir string) (string, error) {
if err := os.MkdirAll(customDir, os.ModePerm); err != nil {
return "", err
}
return customDir, nil
}