1
0
Fork 0

refactor: use fs/ helper to get temp dir

master
dump_stack() 2023-05-13 12:33:12 +00:00
parent 4e77cf82d3
commit c8d171da98
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
1 changed files with 3 additions and 4 deletions

7
cache/cache.go vendored
View File

@ -6,7 +6,6 @@ package cache
import (
"fmt"
"io/ioutil"
"net/url"
"os"
"os/exec"
@ -15,7 +14,7 @@ import (
"github.com/cavaliergopher/grab/v3"
"github.com/rs/zerolog/log"
"code.dumpstack.io/tools/out-of-tree/config"
"code.dumpstack.io/tools/out-of-tree/fs"
)
var URL = "https://out-of-tree.fra1.digitaloceanspaces.com/1.0.0/"
@ -39,7 +38,7 @@ func unpackTar(archive, destination string) (err error) {
}
func DownloadQemuImage(path, file string) (err error) {
tmp, err := ioutil.TempDir(config.Dir("tmp"), "out-of-tree_")
tmp, err := fs.TempDir()
if err != nil {
return
}
@ -65,7 +64,7 @@ func DownloadQemuImage(path, file string) (err error) {
}
func DownloadDebianCache(cachePath string) (err error) {
tmp, err := ioutil.TempDir(config.Dir("tmp"), "out-of-tree_")
tmp, err := fs.TempDir()
if err != nil {
return
}