From f35287dda431fd48706b57f57df7dc4584e2ca30 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Tue, 21 Sep 2021 12:13:32 -0400 Subject: [PATCH] [build2 -> build] -> download-build-artifacts --- .../shared-commands/download-build-artifacts.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/release/shared-commands/download-build-artifacts.js b/scripts/release/shared-commands/download-build-artifacts.js index 7d2763eabc..c7ba16e417 100644 --- a/scripts/release/shared-commands/download-build-artifacts.js +++ b/scripts/release/shared-commands/download-build-artifacts.js @@ -4,6 +4,7 @@ const {exec} = require('child-process-promise'); const {existsSync} = require('fs'); +const fse = require('fs-extra'); const {join} = require('path'); const {getArtifactsList, logPromise} = require('../utils'); const theme = require('../theme'); @@ -11,7 +12,7 @@ const theme = require('../theme'); const run = async ({build, cwd, releaseChannel}) => { const artifacts = await getArtifactsList(build); const buildArtifacts = artifacts.find(entry => - entry.path.endsWith('build2.tgz') + entry.path.endsWith('build.tgz') ); if (!buildArtifacts) { @@ -22,7 +23,7 @@ const run = async ({build, cwd, releaseChannel}) => { } // Download and extract artifact - await exec(`rm -rf ./build2`, {cwd}); + await exec(`rm -rf ./build`, {cwd}); await exec( `curl -L $(fwdproxy-config curl) ${buildArtifacts.url} | tar -xvz`, { @@ -30,6 +31,11 @@ const run = async ({build, cwd, releaseChannel}) => { } ); + // TODO: Currently storing a copy of the artifacts as `./build2`, because + // some scripts reference that directory. Remove once we migrate everything to + // reference `./build` instead. + fse.copySync('./build', './build2'); + // Copy to staging directory // TODO: Consider staging the release in a different directory from the CI // build artifacts: `./build/node_modules` -> `./staged-releases` @@ -50,7 +56,7 @@ const run = async ({build, cwd, releaseChannel}) => { console.error('Internal error: Invalid release channel: ' + releaseChannel); process.exit(releaseChannel); } - await exec(`cp -r ./build2/${sourceDir} ./build/node_modules`, {cwd}); + await exec(`cp -r ./build/${sourceDir} ./build/node_modules`, {cwd}); }; module.exports = async ({build, commit, cwd, releaseChannel}) => {