Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
don't write manifest if we don't need to
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetanley committed Mar 16, 2021
1 parent fc8a649 commit 04fb738
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/tarballs/bin.ts
Expand Up @@ -37,7 +37,7 @@ if exist "%~dp0..\\bin\\node.exe" (
// `)
}
const writeUnix = async () => {
const bin = path.join(baseWorkspace, 'bin', config.bin)
const bin = qq.join([baseWorkspace, 'bin', config.bin])
await fs.writeFile(bin, `#!/usr/bin/env bash
set -e
echoerr() { echo "$@" 1>&2; }
Expand Down
26 changes: 16 additions & 10 deletions src/tarballs/build.ts
Expand Up @@ -68,7 +68,7 @@ async function doBuild(c: IConfig, options: {
await tar.x({
file: tarball,
stripComponents: 1,
cwd: c.workspace()
cwd: c.workspace(),
})
await qq.mkdirp(path.dirname(baseTarballPath))
await qq.mv(tarball, baseTarballPath)
Expand Down Expand Up @@ -109,20 +109,27 @@ async function doBuild(c: IConfig, options: {
const nodePath = targetNodeLocation(target, c)
const workspaceParent = path.dirname(workspace)

log(`building target ${base}`)
if (xz) {
const baseXZ = base.replace('.tar.gz', '.tar.xz')
log(`building target ${baseXZ}`)
}

await qq.cp(baseTarballPath, tarballDist)

await tar.replace({
file: tarballDist,
cwd: workspaceParent,
}, [path.relative(workspaceParent, nodePath)])

if (options.pack === false) return
if (options.pack === false) {
await tar.x({
file: tarballDist,
cwd: workspace,
stripComponents: 1,
})
return
}

log(`building target ${base}`)
if (xz) {
const baseXZ = base.replace('.tar.gz', '.tar.xz')
log(`building target ${baseXZ}`)
}

await compress(tarballDist, xz)
if (!c.updateConfig.s3.host) return
await writeManifest(target, c, config, xz)
Expand Down Expand Up @@ -159,7 +166,6 @@ async function doBuild(c: IConfig, options: {
await addDependencies()
await writeBinScripts({config, baseWorkspace: c.workspace(), nodeVersion: c.nodeVersion})
await buildBaseTarball()
await writeManifest(undefined, c, config, xz)
await downloadNodeBinaries(c)
const targetsToBuild =
options.platform ?
Expand Down

0 comments on commit 04fb738

Please sign in to comment.