Skip to content
Permalink
Browse files
CB-6280: plugman publish now publishes doc/index.md
  • Loading branch information
stevengill committed Apr 23, 2014
1 parent b156a69 commit 967f1164e182d65b4f9c5e2d9ccd415546b9589a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
@@ -73,19 +73,20 @@ function generatePackageJsonFromPluginXml(plugin_path) {
}
}

//adding docs
//set docs_path to doc/index.md exists
var docs_path = path.resolve(plugin_path, 'doc/index.md');
console.log(docs_path);
if(!(fs.existsSync(docs_path))){
//set docs_path to doc/en/index.md
docs_path = path.resolve(plugin_path, 'doc/en/index.md');
}
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');
//console.log('about to write package.json');
fs.writeFileSync(package_json_path, JSON.stringify(package_json, null, 4), 'utf8');
return package_json;
});
@@ -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'));
});
});
},

0 comments on commit 967f116

Please sign in to comment.