Skip to content

Commit

Permalink
feat: pass candidate name to vercel and supabase (#42)
Browse files Browse the repository at this point in the history
This commit creates both Supabase and Vercel project with `-v2` if a name is taken.
  • Loading branch information
maneike authored Nov 25, 2024
1 parent 5f7b8c6 commit c18cd74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/core/installMachine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ const createInstallMachine = (initialContext: InstallMachineContext) => {
createSupabaseProjectActor: createStepMachine(
fromPromise<void, InstallMachineContext, AnyEventObject>(async ({ input }) => {
try {
await createSupabaseProject(input.stateData.options.name);
await createSupabaseProject(input.stateData.githubCandidateName);
input.stateData.stepsCompleted.createSupabaseProject = true;
saveStateToRcFile(input.stateData, input.projectDir);
} catch (error) {
Expand All @@ -446,7 +446,7 @@ const createInstallMachine = (initialContext: InstallMachineContext) => {
linkVercelProjectActor: createStepMachine(
fromPromise<void, InstallMachineContext, AnyEventObject>(async ({ input }) => {
try {
await linkVercelProject();
await linkVercelProject(input.stateData.githubCandidateName);
input.stateData.stepsCompleted.linkVercelProject = true;
saveStateToRcFile(input.stateData, input.projectDir);
} catch (error) {
Expand All @@ -471,7 +471,7 @@ const createInstallMachine = (initialContext: InstallMachineContext) => {
fromPromise<void, InstallMachineContext, AnyEventObject>(async ({ input }) => {
try {
const currentDir = process.cwd();
await connectSupabaseProject(input.stateData.options.name, currentDir);
await connectSupabaseProject(input.stateData.githubCandidateName, currentDir);
input.stateData.stepsCompleted.connectSupabaseProject = true;
saveStateToRcFile(input.stateData, input.projectDir);
} catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/installMachine/installSteps/vercel/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const loginIfNeeded = async () => {
});
};

export const linkVercelProject = async () => {
export const linkVercelProject = async (projectName: string) => {
let vercelUserName = await getUsername();

if (!vercelUserName) {
Expand All @@ -48,7 +48,7 @@ export const linkVercelProject = async () => {

await logger.withSpinner('vercel', 'Linking project...', async (spinner) => {
try {
await execAsync('npx vercel link --yes');
await execAsync(`npx vercel link --yes --project ${projectName}`);
spinner.succeed('Project linked successfully.');
} catch (error) {
spinner.fail('Failed to install.');
Expand Down

0 comments on commit c18cd74

Please sign in to comment.