mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-08 21:40:03 +00:00
Tiny fix.
This commit is contained in:
parent
89dd0773ee
commit
f630b53e0a
@ -48,7 +48,7 @@ export class ElectronPlatformService extends PlatformService {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async getAllFiles (dir: string): string[] {
|
async getAllFiles (dir: string): Promise<string[]> {
|
||||||
let files: string[] = []
|
let files: string[] = []
|
||||||
const items = await fs.readdir(dir, { withFileTypes: true })
|
const items = await fs.readdir(dir, { withFileTypes: true })
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
|
@ -192,16 +192,17 @@ export class SFTPPanelComponent {
|
|||||||
await this.sftp.stat(path.join(this.path, transfer.getRelativePath()))
|
await this.sftp.stat(path.join(this.path, transfer.getRelativePath()))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error && e.message.includes('No such file')) {
|
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)) {
|
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.sftp.mkdir(path.join(this.path, accumPath)).then(() => {
|
||||||
this.notifications.notice('The directory was created successfully')
|
this.notifications.notice('The directory was created successfully')
|
||||||
}).catch(() => {})
|
}).catch(() => {
|
||||||
|
// Intentionally ignoring errors from making duplicate dirs.
|
||||||
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("THROW HERE")
|
throw e
|
||||||
throw e;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await this.sftp.upload(path.join(this.path, transfer.getRelativePath()), transfer)
|
await this.sftp.upload(path.join(this.path, transfer.getRelativePath()), transfer)
|
||||||
|
@ -160,7 +160,7 @@ class HTMLFileDownload extends FileDownload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getRelativePath (): string {
|
getRelativePath (): string {
|
||||||
return ""
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
getMode (): number {
|
getMode (): number {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user