cat dont throw exception on file not found
This commit is contained in:
parent
589fd08c61
commit
89acd8a4a6
|
@ -19,6 +19,10 @@ module.exports = (argv, terminal) => {
|
||||||
let files = argv.filter(x => { return !x.startsWith('-') });
|
let files = argv.filter(x => { return !x.startsWith('-') });
|
||||||
files.shift();
|
files.shift();
|
||||||
files.forEach(file => {
|
files.forEach(file => {
|
||||||
|
if (!fs.existsSync(file)) {
|
||||||
|
terminal.writeln(`${argv[0]}: ${file}: no such file or directory`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const lines = fs.readFileSync(file).toString().split('\n');
|
const lines = fs.readFileSync(file).toString().split('\n');
|
||||||
|
|
||||||
if (numbers) {
|
if (numbers) {
|
||||||
|
|
Loading…
Reference in New Issue