nextjs-subscription-payments icon indicating copy to clipboard operation
nextjs-subscription-payments copied to clipboard

Add --silent flag to piped npx commands

Open chriscarrollsmith opened this issue 1 year ago • 0 comments

I noticed some npm console output getting erroneously piped into the migration and types files. For instance, this script:

"supabase:generate-types": "npx supabase gen types typescript --local --schema public > types_db.ts"

was producing a types file that looked like this:


> [email protected] npx
> supabase gen types typescript --local --schema public

export type Json =
  | string
  | number
  ...

To resolve this, I added the -silent flag to this command:

"supabase:generate-types": "npx --silent supabase gen types typescript --local --schema public > types_db.ts"

And instead of piping a db diff into the migration, I just used push and pull:

    "supabase:push-local": "npx supabase db push --local",
    "supabase:pull-local": "npx supabase db pull --local",
    "supabase:push-remote": "npx supabase db push --remote",
    "supabase:pull-remote": "npx supabase db pull --remote"

chriscarrollsmith avatar Apr 30 '24 20:04 chriscarrollsmith