diff --git a/react/resume/src/emulator/commands/cat.js b/react/resume/src/emulator/commands/cat.js index bdacf30..5301052 100644 --- a/react/resume/src/emulator/commands/cat.js +++ b/react/resume/src/emulator/commands/cat.js @@ -19,6 +19,10 @@ module.exports = (argv, terminal) => { let files = argv.filter(x => { return !x.startsWith('-') }); files.shift(); 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'); if (numbers) {