mirror of
https://github.com/LukeHagar/sailpoint-cli.git
synced 2025-12-10 12:47:50 +00:00
Swapped deprecated dependancy
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user