From 0911712cd42dd88cb1b7d01c7f375a3e428d9efe Mon Sep 17 00:00:00 2001 From: Dimas Saputra Date: Thu, 28 Sep 2023 19:22:35 +0700 Subject: [PATCH] remove lock freeze installation --- .../project-preparation-service.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/service/project-preparation/project-preparation-service.ts b/src/service/project-preparation/project-preparation-service.ts index d933eea..1f3a4f6 100644 --- a/src/service/project-preparation/project-preparation-service.ts +++ b/src/service/project-preparation/project-preparation-service.ts @@ -2,27 +2,10 @@ import {execSync} from "child_process"; import SubmissionProject from "../../entities/submission-project/submission-project"; import ServerErrorException from "../../exception/server-error-exception"; import raiseDomainEvent from "../../common/domain-event"; -import * as fs from "fs"; -import {join} from "path"; class ProjectPreparationService { install(submissionProject: SubmissionProject) { try { - const isPackageLockExist = fs.existsSync(join(submissionProject.packageJsonPath, 'package-lock.json')) - const isYarnLockExist = fs.existsSync(join(submissionProject.packageJsonPath, 'yarn.lock')) - - if (isPackageLockExist) { - execSync('npm ci', {cwd: submissionProject.packageJsonPath, stdio: 'pipe', encoding:'utf-8'}) - raiseDomainEvent('dependencies installed') - return - } - - if (isYarnLockExist) { - execSync('yarn install --frozen-lockfile', {cwd: submissionProject.packageJsonPath, stdio: 'pipe', encoding:'utf-8'}) - raiseDomainEvent('dependencies installed') - return - } - execSync('npm install', {cwd: submissionProject.packageJsonPath, stdio: 'pipe', encoding:'utf-8'}) raiseDomainEvent('dependencies installed') } catch (e) {