Skip to content

Commit 6fcb4d2

Browse files
committed
Refactor file upload and download methods to return promises instead of awaiting them
Signed-off-by: worksofliam <[email protected]>
1 parent e7561c8 commit 6fcb4d2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/api/IBMiContent.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,20 +1095,20 @@ export default class IBMiContent {
10951095
}
10961096
}
10971097

1098-
async uploadFiles(files: { local: string | Uri, remote: string }[], options?: node_ssh.SSHPutFilesOptions) {
1099-
await this.ibmi.client!.putFiles(files.map(f => { return { local: Tools.fileToPath(f.local), remote: f.remote } }), options);
1098+
uploadFiles(files: { local: string | Uri, remote: string }[], options?: node_ssh.SSHPutFilesOptions) {
1099+
return this.ibmi.client!.putFiles(files.map(f => { return { local: Tools.fileToPath(f.local), remote: f.remote } }), options);
11001100
}
11011101

1102-
async downloadFile(localFile: string | Uri, remoteFile: string) {
1103-
await this.ibmi.client!.getFile(Tools.fileToPath(localFile), remoteFile);
1102+
downloadFile(localFile: string | Uri, remoteFile: string) {
1103+
return this.ibmi.client!.getFile(Tools.fileToPath(localFile), remoteFile);
11041104
}
11051105

1106-
async uploadDirectory(localDirectory: string | Uri, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions) {
1107-
await this.ibmi.client!.putDirectory(Tools.fileToPath(localDirectory), remoteDirectory, options);
1106+
uploadDirectory(localDirectory: string | Uri, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions) {
1107+
return this.ibmi.client!.putDirectory(Tools.fileToPath(localDirectory), remoteDirectory, options);
11081108
}
11091109

1110-
async downloadDirectory(localDirectory: string | Uri, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions) {
1111-
await this.ibmi.client!.getDirectory(Tools.fileToPath(localDirectory), remoteDirectory, options);
1110+
downloadDirectory(localDirectory: string | Uri, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions) {
1111+
return this.ibmi.client!.getDirectory(Tools.fileToPath(localDirectory), remoteDirectory, options);
11121112
}
11131113
}
11141114

0 commit comments

Comments
 (0)