Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions src/app/api/install-deps/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const pathExists = async (targetPath: string) => {
export async function POST(req: NextRequest) {
try {
const json = await req.json();
const { network, upgradeId, forceInstall } = json;
const { network, upgradeId } = json;

if (!network || !upgradeId) {
return NextResponse.json(
Expand All @@ -31,7 +31,6 @@ export async function POST(req: NextRequest) {
}

const actualNetwork = network.toLowerCase();
const shouldForceInstall = Boolean(forceInstall);

const safePathPattern = /^[a-zA-Z0-9_-]+$/;
if (!safePathPattern.test(actualNetwork) || !safePathPattern.test(upgradeId)) {
Expand Down Expand Up @@ -67,24 +66,6 @@ export async function POST(req: NextRequest) {
);
}

const libExistsBeforeInstall = await pathExists(libPath);

if (!shouldForceInstall && libExistsBeforeInstall) {
console.log(`Deps already installed for ${actualNetwork}/${upgradeId}; skipping.`);
return NextResponse.json(
{
success: true,
message: `Dependencies already installed for ${actualNetwork}/${upgradeId}`,
libExists: true,
installed: false,
depsInstalled: false,
stdout: '',
stderr: '',
},
{ status: 200 }
);
}

console.log(
`Installing dependencies for ${actualNetwork}/${upgradeId} (cwd: ${resolvedUpgradePath})`
);
Expand Down
Loading