cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cordova-lib git commit: CB-8416 updated plugman publish to temporarily rename existing package.json files
Date Fri, 06 Feb 2015 20:30:15 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/CB-8416 fcf37d03d -> adab8c9ac


CB-8416 updated plugman publish to temporarily rename existing package.json files


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/adab8c9a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/adab8c9a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/adab8c9a

Branch: refs/heads/CB-8416
Commit: adab8c9accfd769019837bb1cc36a2975f9742b0
Parents: fcf37d0
Author: Steve Gill <stevengill97@gmail.com>
Authored: Fri Feb 6 12:29:49 2015 -0800
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Fri Feb 6 12:29:49 2015 -0800

----------------------------------------------------------------------
 .gitignore                                   |  2 ++
 cordova-lib/src/plugman/defaults.json        |  1 -
 cordova-lib/src/plugman/registry/registry.js | 10 ++++++++++
 3 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/adab8c9a/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 88da92b..a7f3e17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,5 @@ spec-cordova/fixtures/projects/cordova
 .idea/*
 .gitcore
 *.jar
+src/plugman/defaults.json
+cordova-lib/src/plugman/defaults.json

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/adab8c9a/cordova-lib/src/plugman/defaults.json
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/defaults.json b/cordova-lib/src/plugman/defaults.json
deleted file mode 100644
index 885af9e..0000000
--- a/cordova-lib/src/plugman/defaults.json
+++ /dev/null
@@ -1 +0,0 @@
-{"id":"org.apache.cordova.device","version":"0.2.14-dev","description":"Cordova Device Plugin","license":"Apache
2.0","repository":"https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git","bugs":"https://issues.apache.org/jira/browse/CB/component/12320648","engines":[],"platforms":["firefoxos","tizen","android","amazon-fireos","ubuntu","ios","blackberry10","wp7","wp8","windows8","windows","browser"]}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/adab8c9a/cordova-lib/src/plugman/registry/registry.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/registry/registry.js b/cordova-lib/src/plugman/registry/registry.js
index 17e5056..4e5e8c6 100644
--- a/cordova-lib/src/plugman/registry/registry.js
+++ b/cordova-lib/src/plugman/registry/registry.js
@@ -87,6 +87,11 @@ module.exports = {
         var dir = args[0] || '.';
         return initSettings()
         .then(function(settings) {
+            if(fs.existsSync(path.join(dir,'package.json'))) {
+                events.emit('verbose', 'temporarily moving existing package.json so we can
create one to publish to the cordova plugins registry');
+                //rename package.json to pacakge.json1 temporarily 
+                fs.renameSync(path.join(dir,'package.json'),path.join(dir,'package.json1'));

+            }
             return manifest.generatePackageJsonFromPluginXml(dir)
             .then(function() {
                 return Q.ninvoke(npm, 'load', settings);
@@ -98,6 +103,11 @@ module.exports = {
                 return Q.ninvoke(npm.commands, 'publish', args);
             }).then(function() {
                 fs.unlink(path.resolve(dir, 'package.json'));
+                //rename package.json1 to package.json if it exists
+                if(fs.existsSync(path.join(dir,'package.json1'))) {
+                    events.emit('verbose', 'restoring original package.json');
+                    fs.renameSync(path.join(dir,'package.json1'),path.join(dir,'package.json'));

+                }
             }).catch(function(err){
                 return err;
             });


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


Mime
View raw message