Skip to content

Commit 8db1cbd

Browse files
fix: update promo CLI examples to use vercel env run
The promo encrypt/decrypt commands require environment variables like CREDIT_CATEGORIES_ENCRYPTION_KEY that are stored in Vercel. Prefix all pnpm promo invocations with 'vercel env run -e production --' so the required env vars are injected at runtime.
1 parent 6e18001 commit 8db1cbd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lib/promoCreditCategories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ const nonSelfServicePromos: readonly NonSelfServicePromoCreditCategoryConfig[] =
327327
* These are decrypted at runtime to build the actual selfServicePromos array.
328328
*
329329
* To add a new promo code:
330-
* 1. Run: pnpm promo encrypt PROMO_CODE
330+
* 1. Run: vercel env run -e production -- pnpm promo encrypt PROMO_CODE
331331
* 2. Copy the encrypted value and use in encrypted_credit_category
332332
*/
333333
const encryptedSelfServicePromos: readonly EncryptedSelfServicePromoCreditCategoryConfig[] = [

src/scripts/encrypt-promo-codes.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* Script to encrypt or decrypt promo codes.
33
*
44
* Run with:
5-
* pnpm promo encrypt <plaintext>
6-
* pnpm promo decrypt <encrypted>
5+
* vercel env run -e production -- pnpm promo encrypt <plaintext>
6+
* vercel env run -e production -- pnpm promo decrypt <encrypted>
77
*
8-
* Requires CREDIT_CATEGORIES_ENCRYPTION_KEY environment variable to be set.
8+
* Requires CREDIT_CATEGORIES_ENCRYPTION_KEY environment variable (injected by vercel env run).
99
*/
1010

1111
import { getEnvVariable } from '@/lib/dotenvx';
@@ -21,7 +21,7 @@ if (!CREDIT_CATEGORIES_ENCRYPTION_KEY) {
2121
const [operation, value] = process.argv.slice(2);
2222

2323
if (!operation || !value) {
24-
console.error('Usage: pnpm promo <encrypt|decrypt> <value>');
24+
console.error('Usage: vercel env run -e production -- pnpm promo <encrypt|decrypt> <value>');
2525
process.exit(1);
2626
}
2727

0 commit comments

Comments
 (0)