Skip to content
This repository was archived by the owner on Jul 17, 2024. It is now read-only.
/ Linux Public archive

Commit 7789f3e

Browse files
committed
🚑 Fixes
1 parent 8c6d084 commit 7789f3e

17 files changed

+362
-1154
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: CI
22
on:
33
repository_dispatch:
44
push:
5-
paths:
6-
- '!*'
7-
- 'src/**'
85
branches:
96
- master
107
jobs:
@@ -22,27 +19,19 @@ jobs:
2219
echo "::set-output name=productName::$(node -p -e "require('./package.json').productName")"
2320
echo "::set-output name=version::$(node -p -e "require('./package.json').version")"
2421
- name: Install Dependencies
25-
run: yarn
26-
- name: Compile TypeScript
27-
run: yarn run init
28-
- name: Install Distributable Modules
29-
run: yarn run dist
30-
- name: Build Packages
3122
run: |
32-
jq -c '.version = "${{ steps.info.outputs.version }}-${{ steps.info.outputs.timestamp }}"' ./dist/app/package.json > tmp.$$.json && mv tmp.$$.json ./dist/app/package.json
33-
yarn run build
34-
env:
35-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
yarn install
24+
yarn run dist
25+
- name: Building
26+
run: yarn run build
3627
- name: Publish
3728
run: |
38-
curl -T ./dist/app/dist/${{ steps.info.outputs.productName }}.deb -udoomlerd:${{ secrets.BT_KEY }} "https://api.bintray.com/content/premid/debian-ubuntu/premid/${{ steps.info.outputs.version }}.${{ steps.info.outputs.timestamp }}/pool/nightly/p/premid_${{ steps.info.outputs.version }}.${{ steps.info.outputs.timestamp }}_amd64.deb;deb_distribution=nightly;deb_component=main;deb_architecture=amd64;publish=1"
39-
curl -T ./dist/app/dist/${{ steps.info.outputs.productName }}.rpm -udoomlerd:${{ secrets.BT_KEY }} "https://api.bintray.com/content/premid/redhat-nightly/premid/${{ steps.info.outputs.version }}.${{ steps.info.outputs.timestamp }}/main/premid-${{ steps.info.outputs.version }}.${{ steps.info.outputs.timestamp }}.x86_64.rpm;publish=1"
29+
curl -T ./dist/app/dist/${{ steps.info.outputs.productName }}.deb -udoomlerd:${{ secrets.BT_KEY }} "https://api.bintray.com/content/premid/debian-ubuntu/premid/${{ steps.info.outputs.version }}-${{ steps.info.outputs.timestamp }}/pool/nightly/p/premid_${{ steps.info.outputs.version }}-${{ steps.info.outputs.timestamp }}_amd64.deb;deb_distribution=nightly;deb_component=main;deb_architecture=amd64;publish=1"
30+
curl -T ./dist/app/dist/${{ steps.info.outputs.productName }}.rpm -udoomlerd:${{ secrets.BT_KEY }} "https://api.bintray.com/content/premid/redhat-nightly/premid/${{ steps.info.outputs.version }}-${{ steps.info.outputs.timestamp }}/main/premid-${{ steps.info.outputs.version }}.${{ steps.info.outputs.timestamp }}.x86_64.rpm;publish=1"
4031
- name: Build AppImage
4132
run: |
4233
jq -c '.productName = "PreMiD Portable"' ./dist/app/package.json > tmp.$$.json && mv tmp.$$.json ./dist/app/package.json
4334
yarn run build:n-appimage
44-
env:
45-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4635
- name: Create Release
4736
uses: softprops/action-gh-release@v1
4837
with:
@@ -68,15 +57,11 @@ jobs:
6857
echo "::set-output name=productName::$(node -p -e "require('./package.json').productName")"
6958
echo "::set-output name=version::$(node -p -e "require('./package.json').version")"
7059
- name: Install Dependencies
71-
run: yarn
72-
- name: Compile TypeScript
73-
run: yarn run init
74-
- name: Install Distributable Modules
75-
run: yarn run dist
76-
- name: Build Packages
60+
run: |
61+
yarn install
62+
yarn run dist
63+
- name: Building
7764
run: yarn run build
78-
env:
79-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8065
- name: Publish
8166
run: |
8267
curl -T ./dist/app/dist/${{ steps.info.outputs.productName }}.deb -udoomlerd:${{ secrets.BT_KEY }} "https://api.bintray.com/content/premid/debian-ubuntu/premid/${{ steps.info.outputs.version }}/pool/stable/p/premid_${{ steps.info.outputs.version }}_amd64.deb;deb_distribution=stable;deb_component=main;deb_architecture=amd64;publish=1"

.gitignore

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
# local dist files
21
node_modules
2+
out
33
dist
4-
src/yarn.lock
5-
src/package.json
6-
7-
# MacOS-generated files
8-
.DS_Store
4+
tmp
95

10-
# local VSCode files
116
.vscode
12-
.history
7+
.env
138

14-
# Yarn logs
15-
*.log
9+
src/package-lock.json
10+
src/yarn.lock
11+
src/package.json
1612

17-
# Super secure files
18-
.env
13+
*.app
14+
*.js

.prettierignore

Lines changed: 0 additions & 25 deletions
This file was deleted.

.prettierrc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @doomlerd

package.json

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"name": "premid",
33
"productName": "PreMiD",
4-
"author": "Jack 'DooMLorD' W. <doomlordcs@gmail.com> (https://github.com/doomlerd)",
4+
"author": "Florian 'Timeraa' Metz <me@timeraa.dev> (https://github.com/timeraa)",
5+
"contributors": [
6+
"Jack 'DooMLorD' W. <doomlordcs@gmail.com> (https://github.com/doomlerd)"
7+
],
58
"description": "Discord Rich Presence for web services",
6-
"version": "2.2.16",
9+
"version": "2.2.17",
710
"repository": {
811
"type": "git",
912
"url": "git://github.com/PreMiD/Linux.git"
@@ -17,19 +20,19 @@
1720
"init": "tsc && devScript --copyOnly",
1821
"start": "electron dist/app/.",
1922
"dev": "devScript",
20-
"dist": "cd dist/app/ && yarn install",
21-
"build": "electron-builder --project ./dist/app/ -p never",
23+
"dist": "tsc && devScript --copyOnly && cd dist/app/ && yarn install",
24+
"build": "electron-builder --project ./dist/app/",
2225
"build:appimage": "electron-builder --project ./dist/app/ build -l AppImage --x64 -p onTagOrDraft",
2326
"build:n-appimage": "electron-builder --project ./dist/app/ build -l AppImage --x64 -p never"
2427
},
2528
"build": {
2629
"appId": "com.PreMiD.app",
2730
"copyright": "PreMiD Org",
2831
"linux": {
32+
"maintainer": "Jack 'DooMLorD' W. <doomlordcs@gmail.com> (https://github.com/doomlerd)",
2933
"category": "Utility",
3034
"artifactName": "${productName}.${ext}",
3135
"icon": "assets/appIcon.icns",
32-
"executableName": "premid",
3336
"target": [
3437
"tar.gz",
3538
"deb",
@@ -38,12 +41,7 @@
3841
"extraFiles": [
3942
"assets/premid.desktop",
4043
"assets/appIcon.png"
41-
],
42-
"desktop": {
43-
"GenericName": "Discord RPC",
44-
"Categories": "Utility;",
45-
"Actions": "StoreURL;ContributorsURL;Debug;Kill;\n\n[Desktop Action StoreURL]\nType=Link\nURL=https://premid.app/store\nName=Presence Store\n\n[Desktop Action ContributorsURL]\nType=Link\nURL=https://premid.app/contributors\nName=Acknowledgments\n\n[Desktop Action Debug]\nTerminal=true\nName=Open in Terminal\n\n[Desktop Action Kill]\nExec=killall -3 premid\nName=Quit"
46-
}
44+
]
4745
},
4846
"publish": [
4947
{
@@ -58,22 +56,19 @@
5856
"devDependencies": {
5957
"@timeraa/devscript": "Timeraa/DevScript",
6058
"@types/auto-launch": "5.0.1",
61-
"@types/discord-rpc": "3.0.3",
62-
"@types/node": "13.13.5",
59+
"@types/discord-rpc": "3.0.2",
60+
"@types/node": "13.9.3",
6361
"@types/socket.io": "2.1.4",
64-
"@typescript-eslint/eslint-plugin": "2.31.0",
65-
"@typescript-eslint/parser": "2.31.0",
66-
"electron": "^7.1.11",
67-
"electron-builder": "22.6.0",
68-
"eslint": "7.0.0",
62+
"electron": "8.2.0",
63+
"electron-builder": "22.4.1",
6964
"typescript": "3.8.3"
7065
},
7166
"dependencies": {
7267
"auto-launch": "5.0.5",
7368
"discord-rpc": "github:discordjs/RPC",
7469
"electron-store": "5.1.1",
75-
"electron-updater": "4.3.1",
70+
"electron-updater": "4.2.5",
7671
"socket.io": "2.3.0",
77-
"source-map-support": "0.5.19"
72+
"source-map-support": "0.5.16"
7873
}
7974
}

src/assets/premid.desktop

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
11
[Desktop Entry]
2-
Type=Application
32
Name=PreMiD
4-
GenericName=Discord RPC
3+
GenericName=PreMiD
54
Comment=Discord Rich Presence for web services
6-
Icon=premid
75
Exec=/usr/bin/premid
86
Terminal=false
9-
Actions=StoreURL;ContributorsURL;Debug;Kill;
10-
Categories=Utility;
11-
12-
[Desktop Action StoreURL]
13-
Type=Link
14-
URL=https://premid.app/store
15-
Name=Presence Store
16-
17-
[Desktop Action ContributorsURL]
18-
Type=Link
19-
URL=https://premid.app/contributors
20-
Name=Acknowledgments
21-
22-
[Desktop Action Debug]
23-
Terminal=true
24-
Name=Open in Terminal
25-
26-
[Desktop Action Kill]
27-
Exec=killall -3 premid
28-
Name=Quit
7+
Type=Application
8+
Icon=premid.png

src/index.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@ import { update as initAutoLaunch } from "./managers/launchManager";
66
import { TrayManager } from "./managers/trayManager";
77
import { checkForUpdate } from "./util/updateChecker";
88

9-
let singleInstanceLock: boolean;
10-
//* Attempt locking to a single instance if app is in production
11-
if (app.isPackaged) singleInstanceLock = app.requestSingleInstanceLock();
129
export let trayManager: TrayManager;
1310

14-
app.on("ready", async () => {
15-
if (!singleInstanceLock && app.isPackaged) return app.exit();
16-
11+
//* When app is ready
12+
export let updateCheckerInterval = null;
13+
app.whenReady().then(async () => {
1714
trayManager = new TrayManager();
1815

19-
initAutoLaunch();
16+
await initAutoLaunch();
2017
await initSocket();
2118

2219
if (app.isPackaged && app.name.includes("Portable")) {
2320
await checkForUpdate(true);
24-
setInterval(() => {
21+
updateCheckerInterval = setInterval(() => {
2522
checkForUpdate(true);
2623
}, 15 * 1000 * 60);
2724
}
2825
});
2926

27+
//* If second instance started, close old one
28+
app.on("second-instance", () => app.exit(0));
29+
3030
//* Send errors from app to extension
31-
process.on("unhandledRejection", (rejection) => {
31+
process.on("unhandledRejection", rejection => {
3232
console.error(rejection);
3333
if (socket && socket.connected) socket.emit("unhandledRejection", rejection);
3434
});
3535

3636
// TODO Find better way to log
37-
process.on("uncaughtException", (err) => {
37+
process.on("uncaughtException", err => {
3838
dialog.showErrorBox(err.name, err.stack);
39-
app.quit();
39+
app.exit(0);
4040
});

0 commit comments

Comments
 (0)