diff --git a/desktop.ejs b/desktop.ejs new file mode 100644 index 0000000..2ccb0e8 --- /dev/null +++ b/desktop.ejs @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Yandex Music +Name[ru]=Яндекс Музыка +Comment=Yandex Music — we collect music for you +Comment[ru]=Яндекс Музыка — собираем музыку для вас +GenericName=YandexMusic +Exec=<%= name %> %U<% if (execArguments && execArguments.length) { %> <%= execArguments.join(' ') %><% } %> +Icon=YandexMusic +Type=Application +StartupNotify=true +Categories=Audio;Music;Player;AudioVideo \ No newline at end of file diff --git a/forge.config.js b/forge.config.js new file mode 100644 index 0000000..847540a --- /dev/null +++ b/forge.config.js @@ -0,0 +1,45 @@ +const commonOptions = { + icon: { + "48x48": "build/next-desktop/favicon.png", + "scalable": "build/next-desktop/favicon.svg" + }, + desktopTemplate: "./desktop.ejs" +} + +module.exports = { + packagerConfig: { + asar: true, + }, + rebuildConfig: {}, + makers: [ + { + name: '@electron-forge/maker-zip', + platforms: ['linux'] + }, + { + name: '@electron-forge/maker-deb', + config: { + options: { + ...commonOptions, + maintainer: 'Cucumber Space', + homepage: 'https://github.com/cucumber-sp/yandex-music-linux' + } + } + }, + { + name: '@electron-forge/maker-rpm', + config: { + options: { + ...commonOptions, + homepage: 'https://github.com/cucumber-sp/yandex-music-linux' + } + } + } + ], + plugins: [ + { + name: '@electron-forge/plugin-auto-unpack-natives', + config: {}, + }, + ], +}; \ No newline at end of file diff --git a/repack.sh b/repack.sh index 4464615..9196dc5 100755 --- a/repack.sh +++ b/repack.sh @@ -97,70 +97,8 @@ npm install @electron/notarize --save-dev npm install --save-dev @electron-forge/cli npx electron-forge import -# set some building parameters from config -forge_config="const commonOptions = { - icon: { - "48x48": "build/next-desktop/favicon.png", - "scalable": "build/next-desktop/favicon.svg" - }, - desktopTemplate: "./desktop.ejs" -} - -module.exports = { - packagerConfig: { - asar: true, - }, - rebuildConfig: {}, - makers: [ - { - name: '@electron-forge/maker-zip', - platforms: ['linux'] - }, - { - name: '@electron-forge/maker-deb', - config: { - options: { - ...commonOptions, - maintainer: 'Cucumber Space', - homepage: 'https://github.com/cucumber-sp/yandex-music-linux' - } - } - }, - { - name: '@electron-forge/maker-rpm', - config: { - options: { - ...commonOptions, - homepage: 'https://github.com/cucumber-sp/yandex-music-linux' - } - } - } - ], - plugins: [ - { - name: '@electron-forge/plugin-auto-unpack-natives', - config: {}, - }, - ], -}; -" -echo Writing Forge Config... -echo "$forge_config" > ./forge.config.js - -desktop_config="[Desktop Entry] -Name=Yandex Music -Name[ru]=Яндекс Музыка -Comment=Yandex Music — we collect music for you -Comment[ru]=Яндекс Музыка — собираем музыку для вас -GenericName=YandexMusic -Exec=<%= name %> %U<% if (execArguments && execArguments.length) { %> <%= execArguments.join(' ') %><% } %> -Icon=YandexMusic -Type=Application -StartupNotify=true -Categories=Audio;Music;Player;AudioVideo" - -echo Writing desktop config... -echo "$desktop_config" > ./desktop.ejs +echo Copy forge.config.js and desktop.ejs... +cp forge.config.js desktop.ejs ./app update_license=0 if prompt_yes_no "In order to build the app we'll need to update the license field in package.json. Continue?"; then