Skip to content

Commit 9120581

Browse files
Platform cleanup
1 parent 9c69320 commit 9120581

File tree

8 files changed

+79
-3
lines changed

8 files changed

+79
-3
lines changed

.github/workflows/build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build_on_linux:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/setup-node@master
10+
with:
11+
node-version: 16
12+
- name: install electron dependencies
13+
run: npm install
14+
- name: install frontend dependencies
15+
run: |
16+
cd frontend
17+
npm install
18+
- name: build-frontend
19+
run: npm run build
20+
- name: build-app
21+
run: npm run electron:build
22+
23+
build_on_mac:
24+
runs-on: macos-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: actions/setup-node@master
28+
with:
29+
node-version: 16
30+
- name: install electron dependencies
31+
run: npm install
32+
- name: install frontend dependencies
33+
run: |
34+
cd frontend
35+
npm install
36+
- name: build-frontend
37+
run: npm run build
38+
- name: build-app
39+
run: npm run electron:build
40+
41+
build_on_win:
42+
runs-on: windows-latest
43+
steps:
44+
- uses: actions/checkout@v2
45+
- uses: actions/setup-node@master
46+
with:
47+
node-version: 16
48+
- name: install electron dependencies
49+
run: npm install
50+
- name: install frontend dependencies
51+
run: |
52+
cd frontend
53+
npm install
54+
- name: build-frontend
55+
run: npm run build
56+
- name: build-app
57+
run: npm run electron:build

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ Oversnip is open source and powered by Electron. Hop in and make it your own!
8181

8282
```
8383
git clone https://github.com/AskingQuestions/oversnip.git
84+
8485
cd oversnip
8586
npm install
87+
cd oversnip/frontend
88+
npm install
89+
90+
cd ../
8691
npm run dev
8792
```

images/icon.icns

45.8 KB
Binary file not shown.

images/icon.png

3.02 KB
Loading

images/icon@2x.png

-1.67 KB
Binary file not shown.

images/iconTemplate.ico

170 KB
Binary file not shown.

main.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,24 @@ function handleSquirrelEvent() {
9292

9393
const path = require("path");
9494
const fs = require("fs");
95+
const os = require("os");
9596
const got = require("got");
9697

97-
const ICON_PATH = path.join(__dirname, "images", "icon.ico");
98-
const TRAY_ICON_PATH = path.join(__dirname, "images", "iconTemplate.png");
98+
let ICON_PATH = "";
99+
let TRAY_ICON_PATH = path.join(__dirname, "images", "iconTemplate.png");
100+
101+
switch (os.platform()) {
102+
case "darwin":
103+
ICON_PATH = path.join(__dirname, "images", "icon.icns");
104+
break;
105+
case "win32":
106+
ICON_PATH = path.join(__dirname, "images", "icon.ico");
107+
TRAY_ICON_PATH = path.join(__dirname, "images", "iconTemplate.ico");
108+
break;
109+
default:
110+
ICON_PATH = path.join(__dirname, "images", "icon.png");
111+
break;
112+
}
99113

100114
const Jimp = require("jimp");
101115

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"config": {
3838
"forge": {
3939
"packagerConfig": {
40-
"icon": "images/icon.ico",
40+
"icon": "images/icon",
4141
"ignore": [
4242
"frontend",
4343
"images/examples"

0 commit comments

Comments
 (0)