mirror of
https://github.com/kopia/kopia.git
synced 2026-01-26 23:38:04 -05:00
* app: added desktop app shell based on Electron that runs in the tray, starts a background kopia server and allows access to the UI * icons: updated icons for the app * htmlui: flexible containers
42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
const path = require('path');
|
|
const isDev = require('electron-is-dev');
|
|
|
|
const osShortName = function() {
|
|
switch (process.platform) {
|
|
case "win32":
|
|
return "win"
|
|
case "darwin":
|
|
return "mac"
|
|
case "linux":
|
|
return "linux"
|
|
default:
|
|
return null
|
|
}
|
|
}();
|
|
|
|
module.exports = {
|
|
resourcesPath: function () {
|
|
if (isDev) {
|
|
return path.join(__dirname, "..", "resources", osShortName);
|
|
}
|
|
return process.resourcesPath;
|
|
},
|
|
defaultServerBinary: function () {
|
|
if (isDev) {
|
|
return {
|
|
"mac": path.join(__dirname, "..", "..", "dist", "kopia_darwin_amd64", "kopia"),
|
|
"win": path.join(__dirname, "..", "..", "dist", "kopia_windows_amd64", "kopia.exe"),
|
|
"linux": path.join(__dirname, "..", "..", "dist", "kopia_linux_amd64", "kopia"),
|
|
}[osShortName]
|
|
}
|
|
|
|
return {
|
|
"mac": path.join(process.resourcesPath, "server", "kopia"),
|
|
"win": path.join(process.resourcesPath, "server", "kopia.exe"),
|
|
"linux": path.join(process.resourcesPath, "server", "kopia"),
|
|
}[osShortName]
|
|
},
|
|
selectByOS: function (x) {
|
|
return x[osShortName]
|
|
},
|
|
} |