Merge pull request #7575 from hashicorp/fix_7534
Step download: always copy local files
This commit is contained in:
commit
dd7030453f
@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/gofrs/flock"
|
||||
@ -88,6 +89,21 @@ func (s *StepDownload) Run(ctx context.Context, state multistep.StateBag) multis
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
var (
|
||||
getters = getter.Getters
|
||||
)
|
||||
|
||||
func init() {
|
||||
if runtime.GOOS == "windows" {
|
||||
getters["file"] = &getter.FileGetter{
|
||||
// always copy local files instead of symlinking to fix GH-7534. The
|
||||
// longer term fix for this would be to change the go-getter so that it
|
||||
// can leave the source file where it is & tell us where it is.
|
||||
Copy: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *StepDownload) download(ctx context.Context, ui packer.Ui, source string) (string, error) {
|
||||
u, err := urlhelper.Parse(source)
|
||||
if err != nil {
|
||||
@ -152,6 +168,7 @@ func (s *StepDownload) download(ctx context.Context, ui packer.Ui, source string
|
||||
ProgressListener: ui,
|
||||
Pwd: wd,
|
||||
Dir: false,
|
||||
Getters: getters,
|
||||
}
|
||||
|
||||
switch err := gc.Get(); err.(type) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user