forked from exercism/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstub-check
More file actions
executable file
·27 lines (22 loc) · 730 Bytes
/
Copy pathstub-check
File metadata and controls
executable file
·27 lines (22 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env node
/**
* Run this script (from root directory): npx babel-node scripts/stub-check
*
* This script checks that all exercises have a stub file.
* Ref: https://github.com/exercism/javascript/issues/705
*/
const shell = require("shelljs");
const helpers = require("./helpers");
const noStubs = helpers.assignments.filter(
(assignment) => !helpers.hasStub(assignment)
);
if (noStubs.length > 0) {
shell.echo("[Error]: No stub files found for following exercises:");
shell.echo(noStubs.join("\n"));
shell.exit(1);
}
if (shell.env["ASSIGNMENT"]) {
shell.echo(`[Success]: Stub file present for ${shell.env["ASSIGNMENT"]}`);
} else {
shell.echo("[Success]: Stub files present for all exercises!");
}