mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
Fix issue introduced handling files in subdirectories ._.
This commit is contained in:
parent
8ba5199e54
commit
61dde4cfac
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user