Skip to content

Commit

Permalink
Merge pull request #892 from Cap-go/supabase_url_init
Browse files Browse the repository at this point in the history
feat: pass supabase url, token for CLI init
  • Loading branch information
riderx authored Nov 20, 2024
2 parents db014bb + c4b254f commit 2603f2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/components/dashboard/Steps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useI18n } from 'petite-vue-i18n'
import { ref, watchEffect } from 'vue'
import { toast } from 'vue-sonner'
import { pushEvent } from '~/services/bento'
import { useSupabase } from '~/services/supabase'
import { getLocalConfig, useSupabase } from '~/services/supabase'
import { sendEvent } from '~/services/tracking'
import { useMainStore } from '~/stores/main'
Expand All @@ -31,10 +31,15 @@ interface Step {
link?: string
}
const config = getLocalConfig()
function isLocal() {
return config.supaHost !== 'https://xvwzpoazmxkqosrdewyv.supabase.co'
}
const simpleStep: Step[] = [
{
title: t('init-capgo-in-your-a'),
command: 'npx @capgo/cli@latest init [APIKEY]',
command: !isLocal() ? `npx @capgo/cli@latest init [APIKEY]` : `npx @capgo/cli@latest init [APIKEY] --supa-host ${config.supaHost} --supa-anon ${config.supaKey}`,
subtitle: '',
link: '',
},
Expand Down
2 changes: 1 addition & 1 deletion src/services/supabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface CapgoConfig {
hostWeb: string
}

function getLocalConfig() {
export function getLocalConfig() {
return {
supaHost: import.meta.env.VITE_SUPABASE_URL as string,
supaKey: import.meta.env.VITE_SUPABASE_ANON_KEY as string,
Expand Down

0 comments on commit 2603f2c

Please sign in to comment.