Browse Source

update

tags/v1.0.0
3136352472 5 years ago
parent
commit
813c7206d8
  1. 20
      lib/tray.js

20
lib/tray.js

@ -178,6 +178,26 @@ ipcMain.on('put-in-tray', (event) => {
mainwin.MainWindow.reload()
}
}, {
label: "检查更新",
click: function () {
let git_url = "https://git.ouxuan.net/3136352472/ouxuan.oa.git";
let workingDirPath = path.join(__dirname, "../");
const simpleGit = require('simple-git')(workingDirPath);
simpleGit.checkIsRepo(function (err, ok) {
if (ok) {
simpleGit.pull(function (r, d) {
if (d.files.length > 0) {
app.quit()
app.relaunch();
}
})
} else {
dialog.showErrorBox(`更新时发生错误`, workingDirPath, err);
}
});
}
}, {
label: "退出",
click: function () {

Loading…
Cancel
Save