mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Export channel from build/config.js
This commit is contained in:
@@ -12,9 +12,28 @@ const buildOutputPath = path.join(repositoryRootPath, 'out')
|
||||
const intermediateAppPath = path.join(buildOutputPath, 'app')
|
||||
const intermediateResourcesPath = path.join(buildOutputPath, 'resources')
|
||||
const cachePath = path.join(repositoryRootPath, 'cache')
|
||||
const channel = getChannel()
|
||||
|
||||
module.exports = {
|
||||
appMetadata,
|
||||
appMetadata, channel,
|
||||
repositoryRootPath, buildOutputPath, intermediateAppPath, intermediateResourcesPath,
|
||||
cachePath
|
||||
}
|
||||
|
||||
function getChannel () {
|
||||
if (appMetadata.version.match(/dev/) || isBuildingPR()) {
|
||||
return 'dev'
|
||||
} else if (appMetadata.version.match(/beta/)) {
|
||||
return 'beta'
|
||||
} else {
|
||||
return 'stable'
|
||||
}
|
||||
}
|
||||
|
||||
function isBuildingPR () {
|
||||
return (
|
||||
process.env.APPVEYOR_PULL_REQUEST_NUMBER ||
|
||||
process.env.TRAVIS_PULL_REQUEST ||
|
||||
process.env.CI_PULL_REQUEST
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user