Don't ignore scripts for code-server prod yarn

This commit is contained in:
Asher 2020-03-16 12:47:39 -05:00
parent d192726e80
commit db4a4f0f50
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
1 changed files with 12 additions and 4 deletions

View File

@ -135,7 +135,7 @@ class Builder {
])
})
await this.copyDependencies("code-server", this.rootPath, this.buildPath, {
await this.copyDependencies("code-server", this.rootPath, this.buildPath, false, {
commit,
version: this.codeServerVersion,
})
@ -181,13 +181,19 @@ class Builder {
])
})
await this.copyDependencies("vs code", this.vscodeSourcePath, vscodeBuildPath, {
await this.copyDependencies("vs code", this.vscodeSourcePath, vscodeBuildPath, true, {
commit,
date: new Date().toISOString(),
})
}
private async copyDependencies(name: string, sourcePath: string, buildPath: string, merge: object): Promise<void> {
private async copyDependencies(
name: string,
sourcePath: string,
buildPath: string,
ignoreScripts: boolean,
merge: object,
): Promise<void> {
await this.task(`copying ${name} dependencies`, async () => {
return Promise.all(
["node_modules", "package.json", "yarn.lock"].map((fileName) => {
@ -214,7 +220,9 @@ class Builder {
if (process.env.MINIFY) {
await this.task(`restricting ${name} to production dependencies`, async () => {
await util.promisify(cp.exec)("yarn --production --ignore-scripts", { cwd: buildPath })
await util.promisify(cp.exec)(`yarn --production ${ignoreScripts ? "--ignore-scripts" : ""}`, {
cwd: buildPath,
})
})
}
}