mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
fix compile error
This commit is contained in:
parent
d27bac9be6
commit
022dd5d7d7
@ -36,8 +36,8 @@ function initWebserver(): void {
|
|||||||
if (home === null) {
|
if (home === null) {
|
||||||
return {
|
return {
|
||||||
res: false,
|
res: false,
|
||||||
msg: "Home server does not exist."
|
msg: "Home server does not exist.",
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
res: true,
|
res: true,
|
||||||
@ -45,11 +45,10 @@ function initWebserver(): void {
|
|||||||
files: home.scripts.map((script) => ({
|
files: home.scripts.map((script) => ({
|
||||||
filename: script.filename,
|
filename: script.filename,
|
||||||
code: script.code,
|
code: script.code,
|
||||||
hash: script.hash(),
|
ramUsage: script.ramUsage,
|
||||||
ramUsage: script.ramUsage
|
})),
|
||||||
}))
|
},
|
||||||
}
|
};
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
(document as any).deleteFile = function (filename: string): IReturnWebStatus {
|
(document as any).deleteFile = function (filename: string): IReturnWebStatus {
|
||||||
@ -58,8 +57,8 @@ function initWebserver(): void {
|
|||||||
if (home === null) {
|
if (home === null) {
|
||||||
return {
|
return {
|
||||||
res: false,
|
res: false,
|
||||||
msg: "Home server does not exist."
|
msg: "Home server does not exist.",
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
return home.removeFile(filename);
|
return home.removeFile(filename);
|
||||||
};
|
};
|
||||||
@ -72,10 +71,10 @@ function initWebserver(): void {
|
|||||||
if (home === null) {
|
if (home === null) {
|
||||||
return {
|
return {
|
||||||
res: false,
|
res: false,
|
||||||
msg: "Home server does not exist."
|
msg: "Home server does not exist.",
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
const {success, overwritten} = home.writeToScriptFile(Player, filename, code);
|
const { success, overwritten } = home.writeToScriptFile(Player, filename, code);
|
||||||
let script;
|
let script;
|
||||||
if (success) {
|
if (success) {
|
||||||
script = home.getScript(filename);
|
script = home.getScript(filename);
|
||||||
@ -84,9 +83,8 @@ function initWebserver(): void {
|
|||||||
res: success,
|
res: success,
|
||||||
data: {
|
data: {
|
||||||
overwritten,
|
overwritten,
|
||||||
hash: script?.hash() || undefined,
|
ramUsage: script?.ramUsage,
|
||||||
ramUsage: script?.ramUsage
|
},
|
||||||
}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user