mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 22:22:18 +08:00
Bump version to v0.17.0-rc1 (#2952)
Add workaround to remove debug information from Electron production binaries on Linux.
This commit is contained in:
parent
10a94ebf1d
commit
f6a1fcd88b
51
.electron-vue/electron-builder/afterPack.js
Normal file
51
.electron-vue/electron-builder/afterPack.js
Normal file
@ -0,0 +1,51 @@
|
||||
'use strict'
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const { exec: execNode } = require("child_process")
|
||||
const util = require('util')
|
||||
|
||||
const exec = util.promisify(execNode)
|
||||
|
||||
// interface AfterPackContext {
|
||||
// outDir: string
|
||||
// appOutDir: string
|
||||
// packager: PlatformPackager<any>
|
||||
// electronPlatformName: string
|
||||
// arch: Arch
|
||||
// targets: Array<Target>
|
||||
// }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {AfterPackContext} context
|
||||
*/
|
||||
const afterPack = async (context) => {
|
||||
// Workaround to remove debug information from production binaries on Linux (Electron#32669).
|
||||
if (context.packager.platform.name === 'linux') {
|
||||
console.log('[afterPack] Removing Electron debug information on Linux')
|
||||
|
||||
const { appOutDir } = context
|
||||
const chromeCrashpadHandlerPath = path.join(appOutDir, 'chrome_crashpad_handler')
|
||||
const libvkPath = path.join(appOutDir, 'libvk_swiftshader.so')
|
||||
|
||||
if (fs.existsSync(chromeCrashpadHandlerPath)) {
|
||||
const { err } = await exec(`strip "${chromeCrashpadHandlerPath}"`)
|
||||
if (err) {
|
||||
console.log('[afterPack] Unable to strip "chrome_crashpad_handler".')
|
||||
}
|
||||
} else {
|
||||
console.log(`[afterPack] "chrome_crashpad_handler" doesn't exists: "${chromeCrashpadHandlerPath}".`)
|
||||
}
|
||||
|
||||
if (fs.existsSync(libvkPath)) {
|
||||
const { err } = await exec(`strip "${libvkPath}"`)
|
||||
if (err) {
|
||||
console.log('[afterPack] Unable to strip "libvk_swiftshader.so".')
|
||||
}
|
||||
} else {
|
||||
console.log(`[afterPack] "libvk_swiftshader.so" doesn't exists: "${libvkPath}".`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = afterPack
|
@ -58,6 +58,7 @@ extraResources:
|
||||
to: "hunspell_dictionaries/"
|
||||
filter:
|
||||
- "!**/LICENSE-hunspell.txt"
|
||||
afterPack: './.electron-vue/electron-builder/afterPack.js'
|
||||
|
||||
fileAssociations:
|
||||
- ext:
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "marktext",
|
||||
"version": "0.16.3",
|
||||
"version": "0.17.0-rc.1",
|
||||
"homepage": "https://marktext.app/",
|
||||
"description": "Next generation markdown editor",
|
||||
"license": "MIT",
|
||||
|
Loading…
Reference in New Issue
Block a user