Skip to content

Commit

Permalink
feat: add script to check stripe acct in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jbranchaud authored and kodiakhq[bot] committed Mar 12, 2024
1 parent 4f17e97 commit b82b2c6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/testing-javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"db:studio": "prisma studio",
"dev": "next dev -p 3018",
"dev:sanity": "sanity dev",
"dev:stripe": "stripe listen --forward-to localhost:3018/api/skill/webhook/stripe",
"dev:stripe": "./scripts/check-stripe && stripe listen --forward-to localhost:3018/api/skill/webhook/stripe",
"lint": "eslint src/**/*.{ts,tsx} --fix && tsc --noEmit",
"start": "next start -p 3018"
},
Expand Down
17 changes: 17 additions & 0 deletions apps/testing-javascript/scripts/check-stripe
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Expected stripe display name
EXPECTED_STRING="KCD Training"

# Currently connected stripe display name
COMMAND_OUTPUT=$(
stripe config --list | grep '^display_name' | awk -F'=' '{print $2}' | xargs
)

# Compare the expected string with the command output
if [ "$EXPECTED_STRING" = "$COMMAND_OUTPUT" ]; then
exit 0 # exit with status 0, indicating success/match
else
echo "Mismatched Stripe accounts, expected $EXPECTED_STRING, got $COMMAND_OUTPUT."
exit 1 # exit with status 1, indicating failure/no match
fi

0 comments on commit b82b2c6

Please sign in to comment.