Skip to content

Commit

Permalink
Use absolute file path for local provider paths (#66)
Browse files Browse the repository at this point in the history
* Use absolute file path for local provider paths

* fix error message
  • Loading branch information
EronWright authored Feb 16, 2024
1 parent 0e4bc02 commit 4c326d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pulumitest/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (a *PulumiTest) Install() string {
cmd.Dir = a.source
out, err := cmd.CombinedOutput()
if err != nil {
a.t.Fatalf("failed to installing packages and plugins: %s\n%s", err, out)
a.t.Fatalf("failed to install packages and plugins: %s\n%s", err, out)
}
return string(out)
}
11 changes: 8 additions & 3 deletions pulumitest/newStack.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,24 @@ func (pt *PulumiTest) NewStack(stackName string, opts ...optnewstack.NewStackOpt
}
sort.Strings(providerPluginNames)
for _, name := range providerPluginNames {
path := providerPluginPaths[providers.ProviderName(name)]
relPath := providerPluginPaths[providers.ProviderName(name)]
absPath, err := filepath.Abs(relPath)
if err != nil {
pt.t.Fatalf("failed to get absolute path for %s: %s", relPath, err)
}

found := false
for _, provider := range providerPlugins {
if provider.Name == name {
provider.Path = path
provider.Path = absPath
found = true
break
}
}
if !found {
providerPlugins = append(providerPlugins, workspace.PluginOptions{
Name: name,
Path: path,
Path: absPath,
})
}
}
Expand Down

0 comments on commit 4c326d6

Please sign in to comment.