You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ra...@apache.org on 2019/04/14 19:50:30 UTC

[cordova-lib] branch master updated: Have plugman.createPackageJson create file in plugin dir, not in cwd (#773)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 77d7da1  Have plugman.createPackageJson create file in plugin dir, not in cwd (#773)
77d7da1 is described below

commit 77d7da1be228bfa9ad7b35ab93c816283d451feb
Author: Raphael von der GrĂ¼n <ra...@gmail.com>
AuthorDate: Sun Apr 14 21:50:25 2019 +0200

    Have plugman.createPackageJson create file in plugin dir, not in cwd (#773)
    
    Right now `plugman createpackagejson <plugin dir>` reads values from `plugin.xml` in `<plugin dir>` but creates the `package.json` in `process.cwd()`. This seems to be undocumented behavior, and is considered a bug.
    
    With this patch, we always create the `package.json` in `<plugin dir>` next to `plugin.xml` instead.
---
 src/plugman/createpackagejson.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/plugman/createpackagejson.js b/src/plugman/createpackagejson.js
index f417210..8cfd16a 100644
--- a/src/plugman/createpackagejson.js
+++ b/src/plugman/createpackagejson.js
@@ -45,8 +45,7 @@ function createPackageJson (plugin_path) {
             events.emit('verbose', 'defaults.json created from plugin.xml');
 
             var initFile = require.resolve('./init-defaults');
-            var dir = process.cwd();
-            return initPkgJson(dir, initFile, {});
+            return initPkgJson(plugin_path, initFile, {});
         })
         .then(_ => {
             events.emit('verbose', 'Package.json successfully created');


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