Fix naming workaround breaking packaging builds

This commit is contained in:
hensm
2019-08-18 06:26:04 +01:00
parent b1c1620723
commit adf62dfa87

View File

@@ -180,17 +180,11 @@ async function build () {
fs.writeFileSync(path.join(BUILD_PATH, "package.json") fs.writeFileSync(path.join(BUILD_PATH, "package.json")
, JSON.stringify(pkgManifest)) , JSON.stringify(pkgManifest))
/**
* With the BUILD_PATH/bridge dir, cannot build to
* BUILD_PATH/bridge file.
*/
const tempExecutableName = `_${executableName[argv.platform]}`;
// Run pkg to create a single executable // Run pkg to create a single executable
await pkg.exec([ await pkg.exec([
BUILD_PATH BUILD_PATH
, "--target", `${pkgPlatform[argv.platform]}-${argv.arch}` , "--target", `${pkgPlatform[argv.platform]}-${argv.arch}`
, "--output", path.join(BUILD_PATH, tempExecutableName) , "--output", path.join(BUILD_PATH, executableName[argv.platform])
]); ]);
// Build NativeMacReceiverSelector // Build NativeMacReceiverSelector
@@ -238,7 +232,7 @@ async function build () {
, path.join(DIST_PATH, manifestName) , path.join(DIST_PATH, manifestName)
, { overwrite: true }); , { overwrite: true });
fs.moveSync( fs.moveSync(
path.join(BUILD_PATH, tempExecutableName) path.join(BUILD_PATH, executableName[argv.platform])
, path.join(DIST_PATH, executableName[argv.platform]) , path.join(DIST_PATH, executableName[argv.platform])
, { overwrite: true }); , { overwrite: true });
@@ -329,7 +323,7 @@ function packageDarwin (
fs.ensureDirSync(rootManifestPath, { recursive: true }); fs.ensureDirSync(rootManifestPath, { recursive: true });
// Move files to root // Move files to root
fs.moveSync(path.join(BUILD_PATH, `_${platformExecutableName}`) fs.moveSync(path.join(BUILD_PATH, platformExecutableName)
, path.join(rootExecutablePath, platformExecutableName)); , path.join(rootExecutablePath, platformExecutableName));
fs.moveSync(path.join(BUILD_PATH, manifestName) fs.moveSync(path.join(BUILD_PATH, manifestName)
, path.join(rootManifestPath, manifestName)); , path.join(rootManifestPath, manifestName));