Skip to content

Commit

Permalink
respect NO_BUN and avoid installing bun
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Sep 23, 2024
1 parent 1e0239b commit 7ce666e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/flag/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ var SST_PASSPHRASE = os.Getenv("SST_PASSPHRASE")
var SST_PULUMI_PATH = os.Getenv("SST_PULUMI_PATH")
var SST_PRINT_LOGS = os.Getenv("SST_PRINT_LOGS") != ""
var SST_BUILD_CONCURRENCY = os.Getenv("SST_BUILD_CONCURRENCY")
var NO_BUN = os.Getenv("NO_BUN") != ""
4 changes: 4 additions & 0 deletions pkg/global/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"strings"

"github.com/pulumi/pulumi/sdk/v3"
"github.com/sst/ion/pkg/flag"
)

var PULUMI_VERSION = "v" + sdk.Version.String()
Expand Down Expand Up @@ -132,6 +133,9 @@ func CertPath() string {
}

func NeedsBun() bool {
if flag.NO_BUN {
return false
}
path := BunPath()
slog.Info("checking for bun", "path", path)
if _, err := os.Stat(path); err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/project/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"path/filepath"
"strings"

"github.com/sst/ion/pkg/flag"
"github.com/sst/ion/pkg/global"
"github.com/sst/ion/pkg/npm"
"golang.org/x/sync/errgroup"
Expand Down Expand Up @@ -154,7 +155,7 @@ func (p *Project) writeTypes() error {
func (p *Project) fetchDeps() error {
slog.Info("fetching deps")
manager := global.BunPath()
if os.Getenv("NO_BUN") != "" {
if flag.NO_BUN {
manager = "npm"
}
cmd := exec.Command(manager, "install")
Expand Down

0 comments on commit 7ce666e

Please sign in to comment.