Skip to content

Commit

Permalink
feat: support project id via env var
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge committed Nov 3, 2023
1 parent 24cf1b8 commit 2a631d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/utils/flags/project_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"

"github.com/spf13/afero"
"github.com/spf13/viper"
"github.com/supabase/cli/internal/utils"
"golang.org/x/term"
)
Expand All @@ -18,6 +19,9 @@ var ProjectRef string

func ParseProjectRef(fsys afero.Fs) error {
// Flag takes highest precedence
if len(ProjectRef) == 0 {
ProjectRef = viper.GetString("PROJECT_ID")
}
if len(ProjectRef) > 0 {
return utils.AssertProjectRefIsValid(ProjectRef)
}
Expand Down

0 comments on commit 2a631d7

Please sign in to comment.