Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
provider: properly handle providers with hyphens in the name
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Sep 3, 2024
1 parent c4d4107 commit 74a86ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/project/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os"
"os/exec"
"path/filepath"
"strings"

"github.com/sst/ion/pkg/global"
"github.com/sst/ion/pkg/npm"
Expand Down Expand Up @@ -232,11 +233,12 @@ func FindProvider(name string, version string) (*ProviderLockEntry, error) {
if pkg.Pulumi.Name == "" {
continue
}
alias := strings.ReplaceAll(pkg.Pulumi.Name, "-", "")
return &ProviderLockEntry{
Name: name,
Package: pkg.Name,
Version: pkg.Version,
Alias: pkg.Pulumi.Name,
Alias: alias,
}, nil
}
return nil, fmt.Errorf("provider %s not found", name)
Expand Down

0 comments on commit 74a86ae

Please sign in to comment.