mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-30 04:47:03 +02:00
Fix problems finding root files in cat and ns.read
Cat ends up translating the path it receives from relative to absolute twice, which I fix by changing the filename to an absolute path before it's passed to getTextFile with a leading "/" so that it doesn't interpret the filename as being relative. Read I fixed by causing getTextFile to remove the leading "/" from files that are in the root directory, since that is required to translate their name into the native "filesystem"s format.
This commit is contained in:
@@ -39,7 +39,7 @@ export function cat(
|
||||
}
|
||||
}
|
||||
} else if (filename.endsWith(".txt")) {
|
||||
const txt = terminal.getTextFile(player, filename);
|
||||
const txt = terminal.getTextFile(player, "/" + filename);
|
||||
if (txt != null) {
|
||||
txt.show();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user