You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2019/05/27 08:40:01 UTC

[cordova-electron] branch master updated: Allow Users to Set Linux App Category (#59)

This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-electron.git


The following commit(s) were added to refs/heads/master by this push:
     new 296c6d0  Allow Users to Set Linux App Category (#59)
296c6d0 is described below

commit 296c6d0c14bc75eb2359a667a75b304c74cb9737
Author: Gedas Gardauskas <ge...@gmail.com>
AuthorDate: Mon May 27 17:39:56 2019 +0900

    Allow Users to Set Linux App Category (#59)
---
 bin/templates/cordova/lib/build.js                  | 3 +++
 tests/spec/unit/templates/cordova/lib/build.spec.js | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index a7baabf..abb5925 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -106,6 +106,9 @@ class ElectronBuilder {
         // eslint-disable-next-line no-template-curly-in-string
         if (platform === 'mac') userBuildSettings.config[platform].type = '${BUILD_TYPE}';
 
+        // Only Linux has an application category (String). Default value - Utility.
+        if (platform === 'linux' && platformConfigs.category) userBuildSettings.config[platform].category = platformConfigs.category;
+
         if (platformConfigs.package) {
             platformConfigs.package.forEach((target) => {
                 if (target === 'mas') {
diff --git a/tests/spec/unit/templates/cordova/lib/build.spec.js b/tests/spec/unit/templates/cordova/lib/build.spec.js
index 8d25bec..eab406f 100644
--- a/tests/spec/unit/templates/cordova/lib/build.spec.js
+++ b/tests/spec/unit/templates/cordova/lib/build.spec.js
@@ -191,7 +191,7 @@ describe('Testing build.js:', () => {
             const platformConfig = {
                 mac: { package: ['package', 'package2'], arch: 'arch', signing: { debug: 'debug', release: 'release', store: 'store' } },
                 win: { package: ['package', 'package2'], arch: 'arch', signing: { debug: 'debug', release: 'release' } },
-                linux: { package: ['package', 'package2'], arch: 'arch' },
+                linux: { package: ['package', 'package2'], arch: 'arch', category: 'Game' },
                 darwin: {}
             };
             const buildConfig = {
@@ -233,7 +233,8 @@ describe('Testing build.js:', () => {
                     { target: 'package', arch: 'arch' },
                     { target: 'package2', arch: 'arch' }
                 ],
-                icon: '${APP_INSTALLER_ICON}'
+                icon: '${APP_INSTALLER_ICON}',
+                category: 'Game'
             };
 
             expect(electronBuilder.userBuildSettings.config.mac).toEqual(expectedMac);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org