mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-21 13:45:44 +01:00
ns.scp: strip leading slashes from filenames if file is in root (#263)
This commit is contained in:
parent
f1793b187b
commit
ae92ea0f94
@ -828,7 +828,10 @@ export const ns: InternalAPI<NSFull> = {
|
|||||||
|
|
||||||
let noFailures = true;
|
let noFailures = true;
|
||||||
//ts detects files as any[] here even though we would have thrown in the above loop if it wasn't string[]
|
//ts detects files as any[] here even though we would have thrown in the above loop if it wasn't string[]
|
||||||
for (const file of files as string[]) {
|
for (let file of files as string[]) {
|
||||||
|
// cut off the leading / for files in the root of the server; this assumes that the filename is somewhat normalized and doesn't look like `//file.js`
|
||||||
|
if (file.startsWith("/") && file.indexOf("/", 1) === -1) file = file.slice(1);
|
||||||
|
|
||||||
// Scp for lit files
|
// Scp for lit files
|
||||||
if (file.endsWith(".lit")) {
|
if (file.endsWith(".lit")) {
|
||||||
const sourceMessage = sourceServ.messages.find((message) => message === file);
|
const sourceMessage = sourceServ.messages.find((message) => message === file);
|
||||||
|
Loading…
Reference in New Issue
Block a user