Skip to content

Commit

Permalink
Resolves #394
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbleasel committed Jan 14, 2025
1 parent 3b203b8 commit d89938b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/initialize.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,17 @@ const setupEnvironmentVariables = async () => {
const setupOrm = (packageManager) => {
log(chalk.green('Setting up Prisma...'));

const filterCommand = packageManager === 'yarn' ? '--workspace' : '--filter';

const command = [
packageManager,
'run',
'build',
'--filter',
filterCommand,
'@repo/database',
];

return execSync(command.join(' '), execSyncOpts);
return execSync(command[packageManager].join(' '), execSyncOpts);
};

/**
Expand All @@ -137,7 +139,7 @@ const updatePackageManagerConfiguration = async (
} else if (packageManager === 'npm') {
packageJson.packageManager = '[email protected]';
} else if (packageManager === 'yarn') {
packageJson.packageManager = 'yarn@4.6.0';
packageJson.packageManager = 'yarn@1.22.22';
}

const newPackageJson = JSON.stringify(packageJson, null, 2);
Expand Down Expand Up @@ -269,7 +271,7 @@ export const initialize = async (options) => {
const packageManager =
options.packageManager || (await getPackageManager());

if (!(packageManager in ['npm', 'yarn', 'bun', 'pnpm'])) {
if (!['npm', 'yarn', 'bun', 'pnpm'].includes(packageManager)) {
throw new Error('Invalid package manager');
}

Expand Down

0 comments on commit d89938b

Please sign in to comment.