Skip to content

Commit

Permalink
Linux build automated as best as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJaredWilcurt committed Sep 21, 2017
1 parent dfead12 commit 85e3a0d
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions build-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ function goUpOneDirectory () {
}

function renameBuiltFolder () {
fs.renameSync('./win32/', './' + nwBuildSettings.appName);
// win32 => Koa11y
// linux64 => Koa11y
fs.renameSync('./' + platform, './' + nwBuildSettings.appName);
}

function zipApp () {
Expand All @@ -220,8 +222,12 @@ function zipApp () {
buildInput = path.join(nwBuildSettings.appName + '.app');
outputZip = path.join('OSX_' + filename);
} else if (process.platform === 'linux') {
buildInput = path.join('linux64');
outputZip = path.join('LIN64_' + filename);
buildInput = path.join(nwBuildSettings.appName);
if (process.arch === 'x64') {
outputZip = path.join('LIN64_' + filename);
} else if (process.arch === 'ia32' || process.arch === 'x86') {
outputZip = path.join('LIN32_' + filename);
}
}

fs.removeSync(outputZip);
Expand All @@ -230,13 +236,7 @@ function zipApp () {
// -tzip = create a zip formatted file
// -mx=9 = use maximum compression
// -y = auto answer yes to all prompts
exec(zipExe + ' a -tzip -mx=9 -y "' + outputZip + '" "' + buildInput) + '"';
if (process.platform === 'linux') {
buildInput = path.join('linux32');
outputZip = path.join('LIN32_' + filename);
fs.removeSync(outputZip);
exec(zipExe + ' a -tzip -mx=9 -y ' + outputZip + ' ' + buildInput);
}
exec(zipExe + ' a -tzip -mx=9 -y "' + outputZip + '" "' + buildInput + '"');
}

function totalBuildTime () {
Expand Down Expand Up @@ -277,6 +277,10 @@ nw.build().then(function () {
console.log(' ∙ Updated ' + nwBuildSettings.appName + '.exe');
}

if (process.platform === 'darwin') {
return;
}

copyManifest();
console.log(' ∙ Copied package.json');

Expand All @@ -298,11 +302,6 @@ nw.build().then(function () {
goUpOneDirectory();
console.log(' ∙ Went up one directory');

if (platform !== 'win32') {
// This is as far as we've gotten on implementing the build for non-windows
return;
}

renameBuiltFolder();
console.log(' ∙ Renamed built folder');

Expand Down

0 comments on commit 85e3a0d

Please sign in to comment.