mirror of
https://github.com/Eugeny/tabby
synced 2024-12-13 14:52:45 +00:00
Tiny fix.
This commit is contained in:
parent
89dd0773ee
commit
f630b53e0a
3 changed files with 8 additions and 7 deletions
|
@ -48,7 +48,7 @@ export class ElectronPlatformService extends PlatformService {
|
|||
})
|
||||
}
|
||||
|
||||
async getAllFiles (dir: string): string[] {
|
||||
async getAllFiles (dir: string): Promise<string[]> {
|
||||
let files: string[] = []
|
||||
const items = await fs.readdir(dir, { withFileTypes: true })
|
||||
for (const item of items) {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -160,7 +160,7 @@ class HTMLFileDownload extends FileDownload {
|
|||
}
|
||||
|
||||
getRelativePath (): string {
|
||||
return ""
|
||||
return ''
|
||||
}
|
||||
|
||||
getMode (): number {
|
||||
|
|
Loading…
Reference in a new issue