-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from davidchambers/disharmony
drop support for unmaintained versions of Node.js
- Loading branch information
Showing
7 changed files
with
55 additions
and
94 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
repo-owner = davidchambers | ||
repo-name = doctest | ||
author-name = David Chambers <[email protected]> | ||
source-files = lib/*.js | ||
source-files = lib/*.js lib/*.mjs | ||
version-tag-prefix = |
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,26 @@ | ||
import common from './common.js'; | ||
import doctest from './doctest.mjs'; | ||
import program from './program.js'; | ||
|
||
common.runDoctests (doctest, program); | ||
|
||
// formatErrors :: Array String -> String | ||
function formatErrors(errors) { | ||
return (errors.map (function(s) { return 'error: ' + s + '\n'; })).join (''); | ||
} | ||
|
||
if (program.args.length === 0) { | ||
process.stderr.write (formatErrors (['No files for doctesting provided'])); | ||
process.exit (1); | ||
} | ||
|
||
Promise.all (program.args.map (function(path) { | ||
return (doctest (path, program)).then (function(results) { | ||
return results.reduce (function(status, tuple) { | ||
return tuple[0] ? status : 1; | ||
}, 0); | ||
}); | ||
})).then (function(statuses) { | ||
process.exit (statuses.every (function(s) { return s === 0; }) ? 0 : 1); | ||
}, function(err) { | ||
process.stderr.write (formatErrors ([err.message])); | ||
process.exit (1); | ||
}); |
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
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
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