Skip to content

Commit 4b90eae

Browse files
committed
Fix windows bug and bump 0.13
1 parent bd8f75b commit 4b90eae

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

internal/provider/generate.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,12 @@ func (g *generator) terraformProviderSchema(ctx context.Context, providerName st
446446

447447
g.infof("compiling provider %q", shortName)
448448
providerPath := fmt.Sprintf("plugins/registry.terraform.io/hashicorp/%s/0.0.1/%s_%s", shortName, runtime.GOOS, runtime.GOARCH)
449-
buildCmd := exec.Command("go", "build", "-o", filepath.Join(tmpDir, providerPath, fmt.Sprintf("terraform-provider-%s", shortName)))
449+
outFile := filepath.Join(tmpDir, providerPath, fmt.Sprintf("terraform-provider-%s", shortName))
450+
switch runtime.GOOS {
451+
case "windows":
452+
outFile = outFile + ".exe"
453+
}
454+
buildCmd := exec.Command("go", "build", "-o", outFile)
450455
// TODO: constrain env here to make it a little safer?
451456
_, err = runCmd(buildCmd)
452457
if err != nil {
@@ -461,7 +466,7 @@ provider %[1]q {
461466
return nil, err
462467
}
463468

464-
tfBin, err := tfinstall.Find(tfinstall.ExactVersion("0.13.0-beta3", tmpDir))
469+
tfBin, err := tfinstall.Find(tfinstall.ExactVersion("0.13.0", tmpDir))
465470
if err != nil {
466471
return nil, err
467472
}

0 commit comments

Comments
 (0)