github-desktop/script/dist-info.js

77 lines
1.7 KiB
JavaScript
Raw Normal View History

2016-05-25 14:37:27 +00:00
'use strict'
const path = require('path')
const projectRoot = path.join(__dirname, '..')
const appPackage = require(path.join(projectRoot, 'package.json'))
2016-05-25 20:48:45 +00:00
function getDistPath () {
2016-05-25 14:37:27 +00:00
return path.join(projectRoot, 'dist', `${appPackage.productName}-${process.platform}-x64`)
}
2016-05-25 20:48:45 +00:00
function getProductName () {
2016-05-25 14:37:27 +00:00
return appPackage.productName
}
2016-06-16 19:42:35 +00:00
function getName () {
return appPackage.name
}
2016-05-25 20:48:45 +00:00
function getCompanyName () {
return appPackage.companyName
}
2016-05-25 20:48:45 +00:00
function getVersion () {
return appPackage.version
}
2016-06-16 19:42:35 +00:00
function getOSXZipName () {
const productName = getProductName()
return `${productName}.zip`
}
2016-05-25 20:48:45 +00:00
function getOSXZipPath () {
2016-06-16 19:42:35 +00:00
return path.join(getDistPath(), '..', getOSXZipName())
}
function getWindowsInstallerName () {
2016-05-25 20:48:45 +00:00
const productName = getProductName()
2016-06-16 19:42:35 +00:00
return `${productName}Setup.msi`
2016-05-25 20:48:45 +00:00
}
function getWindowsInstallerPath () {
2016-06-16 19:42:35 +00:00
return path.join(getDistPath(), '..', 'installer', getWindowsInstallerName())
}
function getWindowsStandaloneName () {
2016-05-25 20:48:45 +00:00
const productName = getProductName()
2016-06-16 19:42:35 +00:00
return `${productName}Setup.exe`
}
function getWindowsStandalonePath () {
return path.join(getDistPath(), '..', 'installer', getWindowsStandaloneName())
}
function getWindowsFullNugetPackageName () {
return `${getName()}-${getVersion()}-full.nupkg`
}
function getWindowsFullNugetPackagePath () {
return path.join(getDistPath(), '..', 'installer', getWindowsFullNugetPackageName())
2016-05-25 20:48:45 +00:00
}
2016-06-16 19:42:35 +00:00
module.exports = {
getDistPath,
getProductName,
getCompanyName,
getVersion,
getOSXZipName,
getOSXZipPath,
getWindowsInstallerName,
getWindowsInstallerPath,
getWindowsStandaloneName,
getWindowsStandalonePath,
getWindowsFullNugetPackageName,
getWindowsFullNugetPackagePath
}