Skip to content

Commit

Permalink
Rename packaged application on OS X and Linux
Browse files Browse the repository at this point in the history
- On OS X, eliminate wrapper directory because app bundle is already
  a directory.
- On Linux, rename wrapper directory to include channel, version, and
  architecture.

Signed-off-by: Antonio Scandurra <as-cii@github.com>
Nathan Sobo authored and Antonio Scandurra committed Aug 3, 2016
1 parent f102fcb commit 210c583
Showing 2 changed files with 30 additions and 3 deletions.
6 changes: 4 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -32,8 +32,10 @@ dependencies:
- script/build --code-sign

post:
- cd out/Atom-darwin-x64 && zip -r ../atom-mac.zip ./Atom.app && cd -
- cd out && zip -r ./atom-mac-symbols.zip ./symbols && cd -
- cd out
- zip -r ./atom-mac.zip ./Atom.app
- zip -r ./atom-mac-symbols.zip ./symbols
- cd -

cache_directories:
- cache
27 changes: 26 additions & 1 deletion script/lib/package-application.js
Original file line number Diff line number Diff line change
@@ -132,8 +132,33 @@ function runPackager (options) {
throw new Error(err)
} else {
assert(packageOutputDirPaths.length === 1, 'Generated more than one electron application!')
resolve(packageOutputDirPaths[0])
const packagedAppPath = renamePackagedAppDir(packageOutputDirPaths[0])
resolve(packagedAppPath)
}
})
})
}

function renamePackagedAppDir (packageOutputDirPath) {
let packagedAppPath
if (process.platform === 'darwin') {
const appBundleName = getAppName() + '.app'
packagedAppPath = path.join(CONFIG.buildOutputPath, appBundleName)
fs.renameSync(path.join(packageOutputDirPath, appBundleName), packagedAppPath)
} else if (process.platform === 'linux') {
const appName = CONFIG.channel === 'beta' ? 'atom-beta' : 'atom'
let architecture
if (process.arch === 'ia32') {
architecture = 'i386'
} else if (process.arch === 'x64') {
architecture = 'amd64'
} else {
architecture = process.arch
}
packagedAppPath = path.join(CONFIG.buildOutputPath, `${appName}-${CONFIG.appMetadata.version}-${architecture}`)
fs.renameSync(packageOutputDirPath, packagedAppPath)
} else {
throw new Error('Implement this!')
}
return packagedAppPath
}

0 comments on commit 210c583

Please sign in to comment.