packge all linux versions (#379)
This commit is contained in:
committed by
Feross Aboukhadijeh
parent
c98f3cd040
commit
e75cd45ec0
@@ -295,41 +295,45 @@ function buildLinux (packageType, cb) {
|
||||
if (err) return cb(err)
|
||||
|
||||
var distPath = path.join(config.ROOT_PATH, 'dist')
|
||||
var filesPath = buildPath[0]
|
||||
|
||||
if (packageType === 'deb' || packageType === 'all') {
|
||||
// Create .deb file for debian based platforms
|
||||
var deb = require('nobin-debian-installer')()
|
||||
var destPath = path.join('/opt', pkg.name)
|
||||
for (var i = 0; i < buildPath.length; i++) {
|
||||
var filesPath = buildPath[i]
|
||||
var destArch = filesPath.split('-').pop()
|
||||
|
||||
deb.pack({
|
||||
package: pkg,
|
||||
info: {
|
||||
arch: 'amd64',
|
||||
targetDir: distPath,
|
||||
depends: 'libc6 (>= 2.4)',
|
||||
scripts: {
|
||||
postinst: path.join(config.STATIC_PATH, 'linux', 'postinst'),
|
||||
prerm: path.join(config.STATIC_PATH, 'linux', 'prerm')
|
||||
if (packageType === 'deb' || packageType === 'all') {
|
||||
// Create .deb file for debian based platforms
|
||||
var deb = require('nobin-debian-installer')()
|
||||
var destPath = path.join('/opt', pkg.name)
|
||||
|
||||
deb.pack({
|
||||
package: pkg,
|
||||
info: {
|
||||
arch: destArch === 'x64' ? 'amd64' : 'i386',
|
||||
targetDir: distPath,
|
||||
depends: 'libc6 (>= 2.4)',
|
||||
scripts: {
|
||||
postinst: path.join(config.STATIC_PATH, 'linux', 'postinst'),
|
||||
prerm: path.join(config.STATIC_PATH, 'linux', 'prerm')
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [{
|
||||
src: ['./**'],
|
||||
dest: destPath,
|
||||
expand: true,
|
||||
cwd: filesPath
|
||||
}], function (err, done) {
|
||||
if (err) return console.error(err.message || err)
|
||||
console.log('Created Linux .deb file.')
|
||||
})
|
||||
}
|
||||
}, [{
|
||||
src: ['./**'],
|
||||
dest: destPath,
|
||||
expand: true,
|
||||
cwd: filesPath
|
||||
}], function (err, done) {
|
||||
if (err) return console.error(err.message || err)
|
||||
console.log('Created Linux ' + destArch + ' .deb file.')
|
||||
})
|
||||
}
|
||||
|
||||
if (packageType === 'zip' || packageType === 'all') {
|
||||
// Create .zip file for Linux
|
||||
var zipPath = path.join(config.ROOT_PATH, 'dist', BUILD_NAME + '-linux.zip')
|
||||
var appFolderName = path.basename(filesPath)
|
||||
cp.execSync(`cd ${distPath} && zip -r -y ${zipPath} ${appFolderName}`)
|
||||
console.log('Created Linux .zip file.')
|
||||
if (packageType === 'zip' || packageType === 'all') {
|
||||
// Create .zip file for Linux
|
||||
var zipPath = path.join(config.ROOT_PATH, 'dist', BUILD_NAME + '-linux-' + destArch + '.zip')
|
||||
var appFolderName = path.basename(filesPath)
|
||||
cp.execSync(`cd ${distPath} && zip -r -y ${zipPath} ${appFolderName}`)
|
||||
console.log('Created Linux ' + destArch + ' .zip file.')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
"electron-packager": "electron-userland/electron-packager",
|
||||
"electron-winstaller": "feross/windows-installer#build",
|
||||
"gh-release": "^2.0.3",
|
||||
"nobin-debian-installer": "^0.0.8",
|
||||
"nobin-debian-installer": "^0.0.9",
|
||||
"plist": "^1.2.0",
|
||||
"standard": "^6.0.5"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user