diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d47a562481..e93fd90d1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: uses: goreleaser/goreleaser-action@v2 with: distribution: goreleaser - version: ~>0.173 + version: v0.183.0 args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GH_PAT }} diff --git a/cmd/link.go b/cmd/link.go index 00d8a648a5..9ecaaf79d8 100644 --- a/cmd/link.go +++ b/cmd/link.go @@ -1,38 +1,26 @@ package cmd import ( - "errors" - "fmt" - "github.com/spf13/cobra" "github.com/supabase/cli/internal/link" ) var ( - useUrl bool + deployDbUrl string linkCmd = &cobra.Command{ Use: "link", Short: "Link the current project to a remote deploy database.", RunE: func(cmd *cobra.Command, args []string) error { - if useUrl { - var deployDbUrl string - fmt.Scanln(&deployDbUrl) - if len(deployDbUrl) == 0 { - return errors.New("Error on `supabase link`: URL is empty.") - } - - return link.Link(deployDbUrl) - } - - return errors.New("Use `--url` to pass the deploy database URL to link to.") + return link.Link(deployDbUrl) }, } ) func init() { linkCmd.Flags(). - BoolVar(&useUrl, "url", false, "Accept Postgres connection string of the deploy database from standard input.") + StringVar(&deployDbUrl, "url", "", "Postgres connection string of the deploy database.") + cobra.CheckErr(linkCmd.MarkFlagRequired("url")) rootCmd.AddCommand(linkCmd) } diff --git a/examples/tour/README.md b/examples/tour/README.md index 9e8c8e3b81..a094cfd2a0 100644 --- a/examples/tour/README.md +++ b/examples/tour/README.md @@ -25,7 +25,7 @@ supabase init This will create a `supabase` directory which is managed by the CLI. Then we need to link the current project with the deploy database. Use the connection string from your Supabase project here. ```sh -supabase link --url <<< 'postgresql://postgres:@db..supabase.co:5432/postgres' +supabase link --url 'postgresql://postgres:@db..supabase.co:5432/postgres' ``` Why do we need to do this? Because if we want to manage a database with a migration tool, we need a _baseline_ where both the migration tool and the database have consistent schemas. `supabase link` does this synchronization between the two.