kopia lustrzana https://github.com/c9/core
Tweaks
rodzic
485f194359
commit
e6f514e5fb
|
@ -78,7 +78,7 @@ define(function(require, exports, module) {
|
|||
var max = [0, 0, 0, 0];
|
||||
list.forEach(function(item){
|
||||
max[0] = Math.max(max[0], item.name.length);
|
||||
max[1] = Math.max(max[1], Math.min(100, item.description.split(".")[0].length));
|
||||
max[1] = Math.max(max[1], Math.min(50, item.description.split(".")[0].length));
|
||||
max[2] = Math.max(max[2], item.name.length + 33);
|
||||
max[3] = Math.max(max[3], (item.website || item.repository.url).length);
|
||||
});
|
||||
|
|
|
@ -243,6 +243,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");
|
||||
|
||||
// Validate plugins
|
||||
|
@ -306,10 +307,14 @@ 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(json, null, indent);
|
||||
fs.writeFile(cwd + "/.c9/.build/pacage.json", newData, function(err){
|
||||
var newData = JSON.stringify(pkgJson, 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
|
||||
fs.writeFile(packagePath, newData, function(err){
|
||||
|
|
Ładowanie…
Reference in New Issue