Skip to content

Commit

Permalink
Bugfix/356 error arch linux (#357)
Browse files Browse the repository at this point in the history
* Trying JS electron-builder config

* All product info now comes from package.json
  • Loading branch information
digimezzo authored Nov 25, 2022
1 parent 1b56b75 commit ab469a5
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 77 deletions.
72 changes: 72 additions & 0 deletions electron-builder.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
const { getFullVersion } = require('./get-package-information.js');

const config = {
appId: "com.digimezzo.dopamine",
productName: "Dopamine",
fileAssociations: [
{
name: "MP3 Files",
description: "MP3 Files",
ext: "mp3",
icon: "build/mp3"
},
{
name: "FLAC Files",
description: "FLAC Files",
ext: "flac",
icon: "build/flac"
},
{
name: "OGG Files",
description: "OGG Files",
ext: "ogg",
icon: "build/ogg"
},
{
name: "M4A Files",
description: "M4A Files",
ext: "m4a",
icon: "build/m4a"
},
{
name: "OPUS Files",
description: "OPUS Files",
ext: "opus",
icon: "build/opus"
},
{
name: "WAV Files",
description: "WAV Files",
ext: "wav",
icon: "build/wav"
}
],
nsis: {
shortcutName: "Dopamine 3",
perMachine: true
},
directories: {
output: "release"
},
files: ["**/*"],
extraResources: ["LICENSE"],
win: {
target: ["nsis"],
artifactName: `\${productName}-${getFullVersion()}.\${ext}`
},
mac: {
target: ["dmg"],
artifactName: `\${productName}-${getFullVersion()}.\${ext}`
},
linux: {
target: ["pacman"],
category: "Audio",
artifactName: `\${productName}-${getFullVersion()}.\${ext}`,
desktop: {
Name: "Dopamine 3",
Terminal: "false"
}
}
};

module.exports = config;
68 changes: 0 additions & 68 deletions electron-builder.json

This file was deleted.

22 changes: 22 additions & 0 deletions get-package-information.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function getName(){
return require('./package.json').name;
}

function getFullVersion() {
const version = require('./package.json').version;
const versionSuffix = require('./package.json').versionSuffix;

if(versionSuffix === ""){
return version;
}

return version + "-" + versionSuffix;
}

function getCopyright(){
return require('./package.json').copyright;
}

module.exports.getName = getName;
module.exports.getFullVersion = getFullVersion;
module.exports.getCopyright = getCopyright;
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "Dopamine",
"version": "3.0.0-preview.19",
"version": "3.0.0",
"versionSuffix": "preview.19",
"copyright": "Copyright Digimezzo Ⓒ 2014 - 2022",
"description": "Audio player",
"homepage": "https://github.com/digimezzo/dopamine",
"author": {
Expand Down Expand Up @@ -29,9 +31,9 @@
"electron:serve-tsc": "tsc -p tsconfig-serve.json",
"electron:serve": "wait-on http-get://localhost:4200/ && npm run electron:serve-tsc && electron . --serve --remote-debugging-port=9222",
"electron:local": "npm run build:prod && electron .",
"electron:linux": "npm run build:prod && electron-builder build --linux",
"electron:windows": "npm run build:prod && electron-builder build --windows",
"electron:mac": "npm run build:prod && electron-builder build --mac",
"electron:linux": "npm run build:prod && electron-builder build --linux --config electron-builder.config.js",
"electron:windows": "npm run build:prod && electron-builder build --windows --config electron-builder.config.js",
"electron:mac": "npm run build:prod && electron-builder build --mac --config electron-builder.config.js",
"version": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"rebuild-sqlite": "./node_modules/.bin/electron-rebuild -f -o better-sqlite3",
"test": "npx jest -w 1 --verbose --noStackTrace",
Expand Down
8 changes: 5 additions & 3 deletions src/app/common/application/product-information.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { getName, getFullVersion, getCopyright } = require('../../../../get-package-information.js');

export class ProductInformation {
public static readonly applicationName: string = require('../../../../package.json').name;
public static readonly applicationVersion: string = require('../../../../package.json').version;
public static readonly applicationCopyright: string = 'Copyright Digimezzo Ⓒ 2014 - 2022';
public static readonly applicationName: string = getName();
public static readonly applicationVersion: string = getFullVersion();
public static readonly applicationCopyright: string = getCopyright();
public static readonly releasesDownloadUrl: string = 'https://github.com/digimezzo/dopamine/releases/';
}

0 comments on commit ab469a5

Please sign in to comment.