Skip to content

Commit

Permalink
create tempfiles in the destination directory to avoid cross-filesyst…
Browse files Browse the repository at this point in the history
…em issues
  • Loading branch information
raizyr committed May 28, 2014
1 parent 3a20318 commit b548ae5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion resource/template/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ func (t *TemplateResource) createStageFile() error {
if !isFileExist(t.Src) {
return errors.New("Missing template: " + t.Src)
}
temp, err := ioutil.TempFile("", "")
// create TempFile in Dest directory to avoid cross-filesystem issues
temp, err := ioutil.TempFile(filepath.Dir(t.Dest), "." + filepath.Base(t.Dest))
if err != nil {
os.Remove(temp.Name())
return err
Expand Down

0 comments on commit b548ae5

Please sign in to comment.