Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #284

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Node.js and Yarn
uses: actions/setup-node@v4
Expand All @@ -37,20 +37,20 @@ jobs:
run: |
sudo snap install snapcraft --classic

- name: Build Linux
- name: 🐧 Build Linux
if: matrix.os == 'ubuntu-latest'
run: npm run release-linux
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}

- name: Build Win
- name: 💻 Build Windows
if: matrix.os == 'windows-latest'
run: npm run release-win
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Build Mac
- name: Build Mac
if: matrix.os == 'macos-latest'
run: npm run release-mac
env:
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
"body-parser": "^1.20.2",
"core-js": "^3.36.1",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"edit-dotenv": "^1.0.4",
"electron-context-menu": "^3.6.1",
"electron-dl": "^3.5.2",
"electron-json-storage": "^4.6.0",
Expand All @@ -59,7 +57,6 @@
"tree-kill": "^1.2.2",
"typescript": "*",
"vue": "3.4.21",
"vue-diff": "^1.2.4",
"vue-i18n": "9.4.1",
"vue-json-pretty": "^2.4.0",
"which": "^4.0.0"
Expand Down
40 changes: 21 additions & 19 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import os from "os";
import * as url from "url";
import fs from "fs";

import contextMenu from "electron-context-menu";
import storage from "electron-json-storage";

import { initSavedDumps } from "./window/saved-dumps";
Expand All @@ -22,6 +21,7 @@ import { createMenu } from "./main-menu";

const isDev: boolean = process.env.NODE_ENV === "development";
const isMac: boolean = process.platform === "darwin";
const AutoLaunch = require("auto-launch");

let mainWindow: BrowserWindow;
let coffeeWindow: BrowserWindow;
Expand All @@ -33,26 +33,26 @@ const minPackageVersion = "2000";

storage.setDataPath(os.tmpdir());

const AutoLaunch = require("auto-launch");

const autoLauncher = new AutoLaunch({ name: "LaraDumps" });
if (!isDev) {
const autoLauncher = new AutoLaunch({ name: "LaraDumps" });

ipcMain.on("main-menu:set-auto-launch", (event: Electron.IpcMainEvent, arg): void => {
arg.value === "disabled" ? autoLauncher.disable() : autoLauncher.enable();
});

autoLauncher
.isEnabled()
.then(function (isEnabled: boolean) {
if (isEnabled) {
return;
}
autoLauncher.enable();
})
.catch(function (err: any) {
console.error("autoLauncher", err);
ipcMain.on("main-menu:set-auto-launch", (event: Electron.IpcMainEvent, arg): void => {
arg.value === "disabled" ? autoLauncher.disable() : autoLauncher.enable();
});

autoLauncher
.isEnabled()
.then(function (isEnabled: boolean) {
if (isEnabled) {
return;
}
autoLauncher.enable();
})
.catch(function (err: any) {
console.error("autoLauncher", err);
});
}

ipcMain.on("dump", (event: Electron.IpcMainEvent, arg): void => {
if (!Object.prototype.hasOwnProperty.call(arg.content, "meta")) {
return;
Expand Down Expand Up @@ -109,7 +109,9 @@ function createWindow(): BrowserWindow {

if (isDev) {
win.loadURL(`http://localhost:4999`);
} else {
}

if (!isDev) {
win.loadURL(
url.format({
pathname: join(__dirname, "app", "index.html"),
Expand Down
Loading