You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/04/24 23:13:25 UTC

[2/7] git commit: added basic support for doc/index.md

added basic support for doc/index.md


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

Branch: refs/heads/browserify
Commit: b156a692d44955bc6a626f99665ce31c613103ad
Parents: 34221b3
Author: Steven Gill <st...@gmail.com>
Authored: Thu Apr 10 16:20:27 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Tue Apr 22 11:39:53 2014 -0700

----------------------------------------------------------------------
 src/registry/manifest.js | 12 ++++++++++++
 src/registry/registry.js |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/b156a692/src/registry/manifest.js
----------------------------------------------------------------------
diff --git a/src/registry/manifest.js b/src/registry/manifest.js
index d7ddc48..f6bcf07 100644
--- a/src/registry/manifest.js
+++ b/src/registry/manifest.js
@@ -41,6 +41,7 @@ function generatePackageJsonFromPluginXml(plugin_path) {
             issue = pluginElm.findtext('issue'),
             engines = pluginElm.findall('engines/engine'),
             platformsElm = pluginElm.findall('platform'),
+            englishdoc = "",
             platforms = [];
 
         platformsElm.forEach(function(plat){
@@ -72,8 +73,19 @@ function generatePackageJsonFromPluginXml(plugin_path) {
             }
         }
 
+        //adding docs
+        var docs_path = path.resolve(plugin_path, 'doc/index.md');
+        console.log(docs_path);
+        if(fs.existsSync(docs_path)){
+            console.log("english docs exisit");
+            englishdoc = fs.readFileSync(docs_path, 'utf-8');
+            package_json.englishdoc = englishdoc;
+            console.log(englishdoc);
+        }
+
         // write package.json
         var package_json_path = path.resolve(plugin_path, 'package.json');
+        console.log('about to write package.json');
         fs.writeFileSync(package_json_path, JSON.stringify(package_json, null, 4), 'utf8');
         return package_json;
     });

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/b156a692/src/registry/registry.js
----------------------------------------------------------------------
diff --git a/src/registry/registry.js b/src/registry/registry.js
index e0d733d..d95d17e 100644
--- a/src/registry/registry.js
+++ b/src/registry/registry.js
@@ -148,7 +148,7 @@ module.exports = {
             }).then(function() {
                 return Q.ninvoke(npm.commands, 'publish', args)
             }).fin(function() {
-                fs.unlink(path.resolve(args[0], 'package.json'));
+                //fs.unlink(path.resolve(args[0], 'package.json'));
             });
         });
     },