Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkg/global/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,24 @@ var configDir = (func() string {
return result
}())

var cacheDir = (func() string {
cache, err := os.UserCacheDir()
if err != nil {
panic(err)
}
result := filepath.Join(cache, "sst")
os.MkdirAll(result, 0755)
return result
}())

func ConfigDir() string {
return configDir
}

func CacheDir() string {
return cacheDir
}

func BinPath() string {
return filepath.Join(configDir, "bin")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/project/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func (p *Project) Run(ctx context.Context, input *StackInput) error {
}
return nodeOptions
}(),
"PULUMI_HOME="+global.ConfigDir(),
"PULUMI_HOME="+global.CacheDir(),
)
if input.ServerPort != 0 {
env = append(env, "SST_SERVER=http://127.0.0.1:"+fmt.Sprint(input.ServerPort))
Expand Down