mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
Fix script autocompletion bug w/ subdirectories (#947)
This commit is contained in:
parent
79b0f83b5f
commit
b46b6e62bc
@ -292,10 +292,14 @@ export async function getTabCompletionPossibilities(terminalText: string, baseDi
|
|||||||
const commands = parseCommands(inputCopy);
|
const commands = parseCommands(inputCopy);
|
||||||
if (commands.length === 0) return;
|
if (commands.length === 0) return;
|
||||||
const command = parseCommand(commands[commands.length - 1]);
|
const command = parseCommand(commands[commands.length - 1]);
|
||||||
const filename = resolveScriptFilePath(String(command[1]), baseDir);
|
let filename = String(command[1]);
|
||||||
if (!filename) return; // Not a script path.
|
if (!filename.startsWith("/")) {
|
||||||
if (filename.endsWith(".script")) return; // Doesn't work with ns1.
|
filename = "./" + filename;
|
||||||
const script = currServ.scripts.get(filename);
|
}
|
||||||
|
const filepath = resolveScriptFilePath(filename, baseDir);
|
||||||
|
if (!filepath) return; // Not a script path.
|
||||||
|
if (filepath.endsWith(".script")) return; // Doesn't work with ns1.
|
||||||
|
const script = currServ.scripts.get(filepath);
|
||||||
if (!script) return; // Doesn't exist.
|
if (!script) return; // Doesn't exist.
|
||||||
|
|
||||||
let loadedModule;
|
let loadedModule;
|
||||||
|
Loading…
Reference in New Issue
Block a user