Skip to content

Commit

Permalink
Merge pull request #5 from sam-cogan/master
Browse files Browse the repository at this point in the history
Remove references to tmp and use working folder
  • Loading branch information
mefellows authored Jan 17, 2019
2 parents 1f3aaa2 + f5d6714 commit 202e1fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions provisioner/dsc/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (p *Provisioner) createDscScript(tpml ExecuteTemplate) (string, error) {
return "", err
}

file, err := ioutil.TempFile("/tmp", "packer-dsc-runner")
file, err := ioutil.TempFile(p.config.WorkingDir, "packer-dsc-runner")
if err != nil {
return "", err
}
Expand Down Expand Up @@ -384,7 +384,7 @@ func (p *Provisioner) uploadDscRunner(ui packer.Ui, comm packer.Communicator, fi
}
defer f.Close()

remoteDscFile := fmt.Sprintf("/tmp/%s.ps1", filepath.Base(file))
remoteDscFile := fmt.Sprintf("%s/%s.ps1", p.config.WorkingDir, filepath.Base(file))
if err := comm.Upload(remoteDscFile, f, nil); err != nil {
return "", err
}
Expand Down Expand Up @@ -443,13 +443,13 @@ func (p *Provisioner) installPackageManagement(ui packer.Ui, comm packer.Communi
}

// Upload script
file, err := ioutil.TempFile("/tmp", "packer-dsc-packagemanagement")
file, err := ioutil.TempFile(p.config.WorkingDir, "packer-dsc-packagemanagement")
if err != nil {
return err
}
err = ioutil.WriteFile(file.Name(), []byte(script), 0655)

remoteScriptFile := fmt.Sprintf("/tmp/%s.ps1", filepath.Base(file.Name()))
remoteScriptFile := fmt.Sprintf("%s/%s.ps1", p.config.WorkingDir, filepath.Base(file.Name()))
if err := comm.Upload(remoteScriptFile, file, nil); err != nil {
return err
}
Expand Down

0 comments on commit 202e1fc

Please sign in to comment.