1 | const fs = require('fs')
|
2 |
|
3 | function stdinStreamProcessor (exercise) {
|
4 | exercise.addProcessor(function (mode, callback) {
|
5 | fs.createReadStream(this.inputFilePath).pipe(this.submissionChild.stdin)
|
6 | if (mode === 'verify') {
|
7 | fs.createReadStream(this.inputFilePath).pipe(this.solutionChild.stdin)
|
8 | }
|
9 |
|
10 | process.nextTick(function () {
|
11 | callback(null, true)
|
12 | })
|
13 | })
|
14 |
|
15 | return exercise
|
16 | }
|
17 |
|
18 | module.exports = stdinStreamProcessor
|