diff --git a/src/Terminal/DirectoryHelpers.ts b/src/Terminal/DirectoryHelpers.ts index 00599feac..04ee8c64e 100644 --- a/src/Terminal/DirectoryHelpers.ts +++ b/src/Terminal/DirectoryHelpers.ts @@ -185,7 +185,7 @@ export function getDestinationFilepath(destination: string, source: string, cwd: return destination; } else { // Append the filename to the directory provided. - let t_path = removeTrailingSlash(dstDir); + const t_path = removeTrailingSlash(dstDir); const fileName = getFileName(source); return t_path + "/" + fileName; } diff --git a/src/Terminal/commands/cat.ts b/src/Terminal/commands/cat.ts index eab054cfc..22453571e 100644 --- a/src/Terminal/commands/cat.ts +++ b/src/Terminal/commands/cat.ts @@ -16,7 +16,8 @@ export function cat( terminal.error("Incorrect usage of cat command. Usage: cat [file]"); return; } - const filename = terminal.getFilepath(args[0] + ""); + const relative_filename = args[0] + ""; + const filename = terminal.getFilepath(relative_filename); if (!filename.endsWith(".msg") && !filename.endsWith(".lit") && !filename.endsWith(".txt")) { terminal.error( "Only .msg, .txt, and .lit files are viewable with cat (filename must end with .msg, .txt, or .lit)", @@ -39,7 +40,7 @@ export function cat( } } } else if (filename.endsWith(".txt")) { - const txt = terminal.getTextFile(player, "/" + filename); + const txt = terminal.getTextFile(player, relative_filename); if (txt != null) { txt.show(); return;