Skip to content

Commit

Permalink
Merge pull request kelseyhightower#77 from raizyr/master
Browse files Browse the repository at this point in the history
os.Rename cross-filesystem issue alternative solution
  • Loading branch information
kelseyhightower committed May 28, 2014
2 parents 63371c4 + b548ae5 commit 413eddc
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 413eddc

Please sign in to comment.