Skip to content

Commit 802a490

Browse files
committed
feat: add condition to adding payload variable
1 parent ea08dd4 commit 802a490

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

packages/core/installMachine/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ const createInstallMachine = (initialContext: InstallMachineContext) => {
425425
deployVercelProjectActor: createStepMachine(
426426
fromPromise<void, InstallMachineContext, AnyEventObject>(async ({ input }) => {
427427
try {
428-
await deployVercelProject();
428+
await deployVercelProject(input.stateData.options.usePayload);
429429
input.stateData.stepsCompleted.deployVercelProject = true;
430430
saveStateToRcFile(input.stateData, input.projectDir);
431431
} catch (error) {

packages/core/installMachine/installSteps/supabase/connectProject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const connectSupabaseProject = async (projectName: string, currentDir: st
6666
type: 'confirm',
6767
name: 'isIntegrationReady',
6868
message: 'Have you completed the GitHub and Vercel integration setup?',
69-
default: false,
69+
default: true,
7070
},
7171
]);
7272

packages/core/installMachine/installSteps/vercel/deploy.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { execSync } from 'node:child_process';
22
import { logWithColoredPrefix } from '../../../utils/logWithColoredPrefix';
33

4-
export const deployVercelProject = async () => {
4+
export const deployVercelProject = async (usePayload: boolean) => {
55
execSync('npx vercel git connect', {
66
stdio: ['inherit', 'pipe', 'inherit'],
77
encoding: 'utf-8',
@@ -13,11 +13,13 @@ export const deployVercelProject = async () => {
1313
encoding: 'utf8',
1414
});
1515

16-
logWithColoredPrefix('vercel', 'Setting up environment variables...');
17-
execSync("grep PAYLOAD_SECRET apps/web/.env | cut -d '=' -f2 | vercel env add PAYLOAD_SECRET production", {
18-
stdio: 'inherit',
19-
encoding: 'utf8',
20-
});
16+
if (usePayload) {
17+
logWithColoredPrefix('vercel', 'Setting up environment variables...');
18+
execSync("grep PAYLOAD_SECRET apps/web/.env | cut -d '=' -f2 | vercel env add PAYLOAD_SECRET production", {
19+
stdio: 'inherit',
20+
encoding: 'utf8',
21+
});
22+
}
2123

2224
if (productionUrl) {
2325
logWithColoredPrefix('vercel', `You can access your production deployment at: \x1b[36m${productionUrl}\x1b[0m`);

0 commit comments

Comments
 (0)