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/06/28 02:01:10 UTC

[cordova-electron] branch master updated: fix: display correct package version in CLI (#77)

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 d642129  fix: display correct package version in CLI (#77)
d642129 is described below

commit d6421290247bd6842cf6ca4bcf658aa56a617b51
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Fri Jun 28 11:01:06 2019 +0900

    fix: display correct package version in CLI (#77)
---
 bin/templates/cordova/version | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/bin/templates/cordova/version b/bin/templates/cordova/version
index ab646fa..259e202 100755
--- a/bin/templates/cordova/version
+++ b/bin/templates/cordova/version
@@ -19,13 +19,15 @@
     under the License.
 */
 
-/*
-    Returns the VERSION of CordovaLib used.
-    Note: it does not work if the --shared option was used to create the project.
-*/
+let VERSION = 'version undefined';
 
-// Coho updates this line
-const VERSION = '1.0.0-dev';
+try {
+    const platformPkgPath = require.resolve('cordova-electron/package.json');
+    const platformPkg = require(platformPkgPath) || null;
+    VERSION = platformPkg.version || VERSION;
+} catch (e) {
+    // Do nothing.
+}
 
 module.exports.version = VERSION;
 


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