Installer/spm/utils.go

21 lines
326 B
Go
Raw Normal View History

2024-12-25 08:46:25 +01:00
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
}