mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-23 22:52:29 +01:00
rm more anys
This commit is contained in:
parent
249242a0a3
commit
810f3a87b9
@ -70,7 +70,7 @@ export class PlayerObject implements IPlayer {
|
||||
moneySourceB: MoneySourceTracker;
|
||||
playtimeSinceLastAug: number;
|
||||
playtimeSinceLastBitnode: number;
|
||||
purchasedServers: any[];
|
||||
purchasedServers: string[];
|
||||
queuedAugmentations: IPlayerOwnedAugmentation[];
|
||||
scriptProdSinceLastAug: number;
|
||||
sleeves: Sleeve[];
|
||||
|
@ -69,8 +69,6 @@ interface IServerMetadata {
|
||||
* A "unique" server that has special implications when the player manually hacks it.
|
||||
*/
|
||||
specialName?: string;
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@ export function exportScripts(pattern: string, server: BaseServer): void {
|
||||
// Return an error if no files matched, rather than an empty zip folder
|
||||
if (Object.keys(zip.files).length == 0) throw new Error(`No files match the pattern ${pattern}`);
|
||||
const zipFn = `bitburner${isScriptFilename(pattern) ? "Scripts" : pattern === "*.txt" ? "Texts" : "Files"}.zip`;
|
||||
zip.generateAsync({ type: "blob" }).then((content: any) => FileSaver.saveAs(content, zipFn));
|
||||
zip.generateAsync({ type: "blob" }).then((content: Blob) => FileSaver.saveAs(content, zipFn));
|
||||
}
|
||||
|
||||
export function download(
|
||||
|
@ -8,18 +8,17 @@ import { BaseServer } from "../../Server/BaseServer";
|
||||
import { evaluateDirectoryPath, getFirstParentDirectory, isValidDirectoryPath } from "../DirectoryHelpers";
|
||||
import { IRouter } from "../../ui/Router";
|
||||
import { ITerminal } from "../ITerminal";
|
||||
import * as libarg from "arg";
|
||||
import libarg from "arg";
|
||||
import { showLiterature } from "../../Literature/LiteratureHelpers";
|
||||
import { MessageFilenames, showMessage } from "../../Message/MessageHelpers";
|
||||
import { ScriptArg } from "../../Netscript/ScriptArg";
|
||||
|
||||
export function ls(
|
||||
terminal: ITerminal,
|
||||
router: IRouter,
|
||||
player: IPlayer,
|
||||
server: BaseServer,
|
||||
args: (string | number | boolean)[],
|
||||
): void {
|
||||
let flags;
|
||||
export function ls(terminal: ITerminal, router: IRouter, player: IPlayer, server: BaseServer, args: ScriptArg[]): void {
|
||||
interface LSFlags {
|
||||
["-l"]: boolean;
|
||||
["--grep"]: string;
|
||||
}
|
||||
let flags: LSFlags;
|
||||
try {
|
||||
flags = libarg(
|
||||
{
|
||||
@ -235,7 +234,7 @@ export function ls(
|
||||
segments: string[];
|
||||
}
|
||||
|
||||
function postSegments(group: FileGroup, flags: any): void {
|
||||
function postSegments(group: FileGroup, flags: LSFlags): void {
|
||||
const segments = group.segments;
|
||||
const linked = group.type === FileType.Script || group.type === FileType.Message;
|
||||
const maxLength = Math.max(...segments.map((s) => s.length)) + 1;
|
||||
|
@ -25,12 +25,12 @@ export function wget(
|
||||
}
|
||||
$.get(
|
||||
url,
|
||||
function (data: any) {
|
||||
function (data: unknown) {
|
||||
let res;
|
||||
if (isScriptFilename(target)) {
|
||||
res = server.writeToScriptFile(player, target, data);
|
||||
res = server.writeToScriptFile(player, target, String(data));
|
||||
} else {
|
||||
res = server.writeToTextFile(target, data);
|
||||
res = server.writeToTextFile(target, String(data));
|
||||
}
|
||||
if (!res.success) {
|
||||
return terminal.error("wget failed");
|
||||
|
Loading…
Reference in New Issue
Block a user