Update doc for ns.scp (#262)

This commit is contained in:
lucebac
2022-12-21 20:56:08 +01:00
committed by GitHub
parent 303c54c85c
commit 5a86be8714
2 changed files with 2 additions and 2 deletions

View File

@@ -817,7 +817,7 @@ export const ns: InternalAPI<NSFull> = {
if (!isValidFilePath(file)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: '${file}'`);
// Invalid file type
if (!file.endsWith(".lit") && !isScriptFilename(file) && !file.endsWith("txt")) {
if (!file.endsWith(".lit") && !isScriptFilename(file) && !file.endsWith(".txt")) {
throw helpers.makeRuntimeErrorMsg(ctx, "Only works for scripts, .lit and .txt files.");
}
}

View File

@@ -5677,7 +5677,7 @@ export interface NS {
* const files = ["hack.js","weaken.js","grow.js"];
* ns.scp(files, server, "home");
* ```
* @param files - Filename or an array of filenames of script/literature files to copy.
* @param files - Filename or an array of filenames of script/literature files to copy. Note that if a file is located in a subdirectory, the filename must include the leading `/`.
* @param destination - Hostname of the destination server, which is the server to which the file will be copied.
* @param source - Hostname of the source server, which is the server from which the file will be copied. This argument is optional and if its omitted the source will be the current server.
* @returns True if the file is successfully copied over and false otherwise. If the files argument is an array then this function will return false if any of the operations failed.