kopia lustrzana https://github.com/c9/core
report proper error in c9 publish if readme is missing
rodzic
86b106f737
commit
fac2e66d39
|
|
@ -267,19 +267,21 @@ define(function(require, exports, module) {
|
|||
if (!json.categories || json.categories.length == 0)
|
||||
return callback(new Error("ERROR: At least one category is required in package.json"));
|
||||
|
||||
var description = json.description;
|
||||
|
||||
if (description)
|
||||
console.warn("WARNING: Description property in package.json will be ignored. README.md will be used.");
|
||||
|
||||
// Validate README.md
|
||||
if (!fs.existsSync(join(cwd, "README.md"))) {
|
||||
if (fs.existsSync(join(cwd, "README.md"))) {
|
||||
description = fs.readFileSync(join(cwd, "README.md"), "utf8")
|
||||
.replace(/^\#.*\n*/, "");
|
||||
} else {
|
||||
console.warn("WARNING: README.md is missing.");
|
||||
if (!force)
|
||||
return callback(new Error("Use --force to ignore these warnings."));
|
||||
}
|
||||
|
||||
if (json.description)
|
||||
console.warn("WARNING: Description property in package.json will be ignored. README.md will be used.");
|
||||
|
||||
var description = fs.readFileSync(join(cwd, "README.md"), "utf8")
|
||||
.replace(/^\#.*\n*/, "");
|
||||
|
||||
// Validate plugins
|
||||
var plugins = {};
|
||||
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue