do not destroy package.json of published plugin

pull/85/head
nightwing 2015-04-29 02:27:11 +04:00
rodzic 3bbff9b45b
commit 16136f2c47
3 zmienionych plików z 7 dodań i 11 usunięć

Wyświetl plik

@ -112,7 +112,8 @@ return [
hosted: false,
local: true,
home: process.env.HOME,
setStatus: function(){}
setStatus: function(){},
location: ""
},
error_handler: {
log: function(){}

Wyświetl plik

@ -83,7 +83,7 @@
"c9.ide.help.support": "#60e88f5680",
"c9.ide.imgeditor": "#08bbc53578",
"c9.ide.immediate": "#6845a93705",
"c9.ide.installer": "#02e7018bf6",
"c9.ide.installer": "#63c3c021e3",
"c9.ide.mount": "#32e79866ee",
"c9.ide.navigate": "#64156c7f4a",
"c9.ide.newresource": "#f1f0624768",

Wyświetl plik

@ -245,8 +245,7 @@ define(function(require, exports, module) {
if (json.description)
console.warn("WARNING: Description property in package.json will be ignored. README.md will be used.");
var originalDesc = json.description;
json.description = fs.readFileSync(join(cwd, "README.md"), "utf8")
var description = fs.readFileSync(join(cwd, "README.md"), "utf8")
.replace(/^\#.*\n*/, "");
// Validate plugins
@ -310,13 +309,9 @@ define(function(require, exports, module) {
if (!version)
return next();
// Reset description
var pkgJson = Object.create(json);
pkgJson.description = originalDesc;
// Write the package.json file
var indent = data.match(/{\n\r?^ {4}"/) ? 4 : 2;
var newData = JSON.stringify(pkgJson, null, indent);
var newData = JSON.stringify(json, null, indent);
fs.writeFile(cwd + "/.c9/.build/pacage.json", newData, function(){
if (dryRun)
return next(); // if dry-run is passed only update path in .build
@ -651,7 +646,7 @@ define(function(require, exports, module) {
contentType: "application/json",
body: {
name: json.name,
description: json.description,
description: description,
owner_type: "user", // @TODO implement this when adding orgs
owner_id: parseInt(user.id),
permissions: json.permissions || "world",
@ -683,7 +678,7 @@ define(function(require, exports, module) {
repository: json.repository,
longname: json.longname,
website: json.website,
description: json.description,
description: description,
screenshots: json.screenshots,
pricing: json.pricing,
enabled: true