mirror of https://github.com/laurent22/joplin.git
Merge branch 'master' of github.com:laurent22/joplin
commit
c901228dc5
|
@ -512,12 +512,20 @@ class Application extends BaseApplication {
|
||||||
|
|
||||||
function _showAbout() {
|
function _showAbout() {
|
||||||
const p = packageInfo;
|
const p = packageInfo;
|
||||||
|
let gitInfo = '';
|
||||||
|
if ("git" in p) {
|
||||||
|
gitInfo = _('Revision: %s (%s)', p.git.hash, p.git.branch);
|
||||||
|
}
|
||||||
let message = [
|
let message = [
|
||||||
p.description,
|
p.description,
|
||||||
'',
|
'',
|
||||||
'Copyright © 2016-2019 Laurent Cozic',
|
'Copyright © 2016-2019 Laurent Cozic',
|
||||||
_('%s %s (%s, %s)', p.name, p.version, Setting.value('env'), process.platform),
|
_('%s %s (%s, %s)', p.name, p.version, Setting.value('env'), process.platform),
|
||||||
];
|
];
|
||||||
|
if (!!gitInfo) {
|
||||||
|
message.push("\n" + gitInfo);
|
||||||
|
console.info(gitInfo);
|
||||||
|
}
|
||||||
bridge().showInfoMessageBox(message.join('\n'), {
|
bridge().showInfoMessageBox(message.join('\n'), {
|
||||||
icon: bridge().electronApp().buildDir() + '/icons/32x32.png',
|
icon: bridge().electronApp().buildDir() + '/icons/32x32.png',
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
|
const execSync = require('child_process').execSync;
|
||||||
|
|
||||||
// Electron Builder strip off certain important keys from package.json, which we need, in particular build.appId
|
// Electron Builder strip off certain important keys from package.json, which we need, in particular build.appId
|
||||||
// so this script is used to preserve the keys that we need.
|
// so this script is used to preserve the keys that we need.
|
||||||
|
@ -16,6 +17,19 @@ const appId = packageInfo.build.appId;
|
||||||
delete packageInfo.build;
|
delete packageInfo.build;
|
||||||
packageInfo.build = { appId: appId };
|
packageInfo.build = { appId: appId };
|
||||||
|
|
||||||
|
let branch;
|
||||||
|
let hash;
|
||||||
|
try {
|
||||||
|
branch = execSync('git branch --show-current').toString().trim();
|
||||||
|
hash = execSync('git log --pretty="%h" -1').toString().trim();
|
||||||
|
}
|
||||||
|
catch(err) {
|
||||||
|
console.warn("Could not get git info", err);
|
||||||
|
}
|
||||||
|
if (typeof branch !== 'undefined' && typeof hash !== 'undefined') {
|
||||||
|
packageInfo.git = { branch: branch, hash: hash };
|
||||||
|
}
|
||||||
|
|
||||||
let fileContent = "// Auto-generated by compile-package-info.js\n// Do not change directly\nconst packageInfo = " + JSON.stringify(packageInfo, null, 4) + ';';
|
let fileContent = "// Auto-generated by compile-package-info.js\n// Do not change directly\nconst packageInfo = " + JSON.stringify(packageInfo, null, 4) + ';';
|
||||||
fileContent += "\n";
|
fileContent += "\n";
|
||||||
fileContent += "module.exports = packageInfo;";
|
fileContent += "module.exports = packageInfo;";
|
||||||
|
|
Loading…
Reference in New Issue