From f630b53e0a9bfe0e504427e75b513187f291e1ae Mon Sep 17 00:00:00 2001 From: marko1616 Date: Wed, 21 Aug 2024 14:33:11 +0800 Subject: [PATCH] Tiny fix. --- tabby-electron/src/services/platform.service.ts | 2 +- tabby-ssh/src/components/sftpPanel.component.ts | 11 ++++++----- tabby-web/src/platform.ts | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tabby-electron/src/services/platform.service.ts b/tabby-electron/src/services/platform.service.ts index 63e28f89..87d5fca5 100644 --- a/tabby-electron/src/services/platform.service.ts +++ b/tabby-electron/src/services/platform.service.ts @@ -48,7 +48,7 @@ export class ElectronPlatformService extends PlatformService { }) } - async getAllFiles (dir: string): string[] { + async getAllFiles (dir: string): Promise { let files: string[] = [] const items = await fs.readdir(dir, { withFileTypes: true }) for (const item of items) { diff --git a/tabby-ssh/src/components/sftpPanel.component.ts b/tabby-ssh/src/components/sftpPanel.component.ts index 1f524bba..773e34c0 100644 --- a/tabby-ssh/src/components/sftpPanel.component.ts +++ b/tabby-ssh/src/components/sftpPanel.component.ts @@ -192,16 +192,17 @@ export class SFTPPanelComponent { await this.sftp.stat(path.join(this.path, transfer.getRelativePath())) } catch (e) { if (e instanceof Error && e.message.includes('No such file')) { - let accumPath = "" + let accumPath = '' for (const pathParts of path.posix.dirname(transfer.getRelativePath()).split(path.posix.sep)) { - accumPath = path.posix.join(accumPath,pathParts) + accumPath = path.posix.join(accumPath, pathParts) this.sftp.mkdir(path.join(this.path, accumPath)).then(() => { this.notifications.notice('The directory was created successfully') - }).catch(() => {}) + }).catch(() => { + // Intentionally ignoring errors from making duplicate dirs. + }) } } else { - console.log("THROW HERE") - throw e; + throw e } } await this.sftp.upload(path.join(this.path, transfer.getRelativePath()), transfer) diff --git a/tabby-web/src/platform.ts b/tabby-web/src/platform.ts index ddab757d..aa1d5045 100644 --- a/tabby-web/src/platform.ts +++ b/tabby-web/src/platform.ts @@ -160,7 +160,7 @@ class HTMLFileDownload extends FileDownload { } getRelativePath (): string { - return "" + return '' } getMode (): number {