Swapped deprecated dependancy

This commit is contained in:
luke-hagar-sp
2022-12-20 12:57:56 -06:00
parent d382a43fc0
commit 7ed1666458

View File

@@ -5,7 +5,6 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"net/http" "net/http"
"os" "os"
"path/filepath" "path/filepath"
@@ -60,10 +59,24 @@ func newDownloadCmd(client client.Client) *cobra.Command {
var err error var err error
if destination != "" { if destination != "" {
_ = os.Mkdir(destination, os.ModePerm) // Make sure the output dir exists first _ = os.MkdirAll(destination, os.ModePerm) // Make sure the output dir exists first
err = ioutil.WriteFile(filepath.Join(destination, filename), content, os.ModePerm) file, err := os.Open(filepath.Join(destination, filename))
if err != nil {
return err
}
_, err = file.Write(content)
if err != nil {
return err
}
} else { } else {
err = ioutil.WriteFile(filename, content, os.ModePerm) file, err := os.Open(filename)
if err != nil {
return err
}
_, err = file.Write(content)
if err != nil {
return err
}
} }
if err != nil { if err != nil {