mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-14 18:42:24 +03:00
fixes lint and test errors
This commit is contained in:
@@ -1,23 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const program = require('commander');
|
||||
const version = require('../package.json').version;
|
||||
const { version } = require('../package.json');
|
||||
|
||||
program
|
||||
.version(version)
|
||||
.parse(process.argv);
|
||||
|
||||
const options = {};
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function readFile(filename, encoding, callback) {
|
||||
if (options.file === '-') {
|
||||
// read from stdin
|
||||
const chunks = [];
|
||||
|
||||
process.stdin.on('data', function (chunk) { chunks.push(chunk); });
|
||||
|
||||
process.stdin.on('end', function () {
|
||||
return callback(null, Buffer.concat(chunks).toString(encoding));
|
||||
process.stdin.on('data', (chunk) => {
|
||||
chunks.push(chunk);
|
||||
});
|
||||
|
||||
process.stdin.on('end', () => callback(null, Buffer.concat(chunks).toString(encoding)));
|
||||
} else {
|
||||
fs.readFile(filename, encoding, callback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user