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];
|
var max = [0, 0, 0, 0];
|
||||||
list.forEach(function(item){
|
list.forEach(function(item){
|
||||||
max[0] = Math.max(max[0], item.name.length);
|
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[2] = Math.max(max[2], item.name.length + 33);
|
||||||
max[3] = Math.max(max[3], (item.website || item.repository.url).length);
|
max[3] = Math.max(max[3], (item.website || item.repository.url).length);
|
||||||
});
|
});
|
||||||
|
|
|
@ -243,6 +243,7 @@ define(function(require, exports, module) {
|
||||||
if (json.description)
|
if (json.description)
|
||||||
console.warn("WARNING: Description property in package.json will be ignored. README.md will be used.");
|
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");
|
json.description = fs.readFileSync(join(cwd, "README.md"), "utf8");
|
||||||
|
|
||||||
// Validate plugins
|
// Validate plugins
|
||||||
|
@ -306,10 +307,14 @@ define(function(require, exports, module) {
|
||||||
if (!version)
|
if (!version)
|
||||||
return next();
|
return next();
|
||||||
|
|
||||||
|
// Reset description
|
||||||
|
var pkgJson = Object.create(json);
|
||||||
|
pkgJson.description = originalDesc;
|
||||||
|
|
||||||
// Write the package.json file
|
// Write the package.json file
|
||||||
var indent = data.match(/{\n\r?^ {4}"/) ? 4 : 2;
|
var indent = data.match(/{\n\r?^ {4}"/) ? 4 : 2;
|
||||||
var newData = JSON.stringify(json, null, indent);
|
var newData = JSON.stringify(pkgJson, null, indent);
|
||||||
fs.writeFile(cwd + "/.c9/.build/pacage.json", newData, function(err){
|
fs.writeFile(cwd + "/.c9/.build/pacage.json", newData, function(){
|
||||||
if (dryRun)
|
if (dryRun)
|
||||||
return next(); // if dry-run is passed only update path in .build
|
return next(); // if dry-run is passed only update path in .build
|
||||||
fs.writeFile(packagePath, newData, function(err){
|
fs.writeFile(packagePath, newData, function(err){
|
||||||
|
|
Ładowanie…
Reference in New Issue