mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
mk TempDir
This commit is contained in:
parent
9de2039c31
commit
b7b6988e76
@ -423,6 +423,14 @@ func readAndUpdate(stdOut io.Writer, inputFile string, updateData updateDataFn)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// mkdir temp dir as some docker images does not have temp dir
|
||||||
|
_, err = os.Stat(os.TempDir())
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
err = os.Mkdir(os.TempDir(), 0700)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
tempFile, err := ioutil.TempFile("", "temp")
|
tempFile, err := ioutil.TempFile("", "temp")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user