Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start setting up the build infrastructure
- Loading branch information
1 parent
f3ec1d7
commit a4bd463
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
language: node_js | ||
script: | ||
- node validate.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
checkRegistry(source) { | ||
guides = JSON.parse(source); | ||
for (var i = 0; i < out.guides.length; i++) { | ||
var g = out.guides[i]; | ||
if (g['npm-name'] == null) | ||
throw "A npm package name is required"; | ||
if (g.name == null) | ||
throw "A name is required for guide "+g['npm-name']; | ||
if (g.category == null) | ||
throw "A category is required for guide "+g.name; | ||
if (g.description == null) | ||
throw "A description is required for guide "+g.name; | ||
if (g.authority == null) | ||
throw "An authority is required for guide "+g.name; | ||
if (g.country == null) | ||
throw "A country is required for guide "+g.name; | ||
} | ||
for (var i1 = 0; i1 < out.guides.length; i1++) { | ||
var g1 = out.guides[i1]; | ||
for (var i2 = i1+1; i2 < out.guides.length; i2++) { | ||
var g2 = out.guides[i2]; | ||
if (g1.name = g2.name) | ||
throw "The name '"+g1.name+"' is duplicated"; | ||
if (g1['npm-name'] = g2['npm-name']) | ||
throw "The package name '"+g1['npm-name']+"' is duplicated"; | ||
} | ||
} | ||
} | ||
|