Skip to content

Commit

Permalink
Merge pull request #61 from prisma/ankur-patch
Browse files Browse the repository at this point in the history
fix: ensure pulse api key is extracted
  • Loading branch information
ankur-arch authored Oct 29, 2024
2 parents ce01168 + cd8e0a0 commit 6da40a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import logger from "./helpers/logger";
import vscodeExtensionSuggestion from "./helpers/vscodeExtensionSuggestion";
import chalk from "chalk";


const main = async () => {
const cli = new CLI();
await cli.initialize();
Expand Down Expand Up @@ -62,7 +63,8 @@ const main = async () => {

if (input.databaseUrl) {
fs.writeFileSync(`${input.path}/${input.name}/.env`, `DATABASE_URL="${input.databaseUrl}"\n`, { flag: "a" })
if (input.databaseUrl.startsWith("prisma://")) {

if (input.databaseUrl.startsWith("prisma://") || input.databaseUrl.startsWith("prisma+postgres://")) {
const queryParams = input.databaseUrl.split("?")[1]
const urlParams = new URLSearchParams(queryParams)
const apiKey = urlParams.get("api_key")
Expand Down

0 comments on commit 6da40a3

Please sign in to comment.