mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-22 04:19:54 +00:00
Lint pass.
This commit is contained in:
parent
deaa529c07
commit
89dd0773ee
@ -205,7 +205,7 @@ export class HTMLFileUpload extends FileUpload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getRelativePath (): string {
|
getRelativePath (): string {
|
||||||
return ""
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
getMode (): number {
|
getMode (): number {
|
||||||
|
@ -48,7 +48,7 @@ export class ElectronPlatformService extends PlatformService {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async getAllFiles(dir: string) {
|
async getAllFiles (dir: string): 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) {
|
||||||
@ -229,9 +229,9 @@ export class ElectronPlatformService extends PlatformService {
|
|||||||
let allFiles: string[] = []
|
let allFiles: string[] = []
|
||||||
let relativePaths: string[] = []
|
let relativePaths: string[] = []
|
||||||
for (const folderPath of paths) {
|
for (const folderPath of paths) {
|
||||||
let files = await this.getAllFiles(folderPath)
|
const files = await this.getAllFiles(folderPath)
|
||||||
allFiles = allFiles.concat(files)
|
allFiles = allFiles.concat(files)
|
||||||
relativePaths = relativePaths.concat(files.map(file => path.posix.join(path.basename(folderPath),path.posix.relative(folderPath, file))))
|
relativePaths = relativePaths.concat(files.map(file => path.posix.join(path.basename(folderPath), path.posix.relative(folderPath, file))))
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.all(allFiles.map(async (p, index) => {
|
return Promise.all(allFiles.map(async (p, index) => {
|
||||||
@ -300,7 +300,7 @@ class ElectronFileUpload extends FileUpload {
|
|||||||
private buffer: Buffer
|
private buffer: Buffer
|
||||||
private powerSaveBlocker = 0
|
private powerSaveBlocker = 0
|
||||||
|
|
||||||
constructor (private filePath: string, private electron: ElectronService, private relativePath: string="") {
|
constructor (private filePath: string, private electron: ElectronService, private relativePath = '') {
|
||||||
super()
|
super()
|
||||||
this.buffer = Buffer.alloc(256 * 1024)
|
this.buffer = Buffer.alloc(256 * 1024)
|
||||||
this.powerSaveBlocker = electron.powerSaveBlocker.start('prevent-app-suspension')
|
this.powerSaveBlocker = electron.powerSaveBlocker.start('prevent-app-suspension')
|
||||||
@ -316,7 +316,7 @@ class ElectronFileUpload extends FileUpload {
|
|||||||
getName (): string {
|
getName (): string {
|
||||||
return path.basename(this.filePath)
|
return path.basename(this.filePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
getRelativePath (): string {
|
getRelativePath (): string {
|
||||||
return this.relativePath
|
return this.relativePath
|
||||||
}
|
}
|
||||||
@ -364,7 +364,7 @@ class ElectronFileDownload extends FileDownload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getRelativePath (): string {
|
getRelativePath (): string {
|
||||||
return ""
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
getMode (): number {
|
getMode (): number {
|
||||||
|
@ -187,7 +187,7 @@ export class SFTPPanelComponent {
|
|||||||
|
|
||||||
async uploadOneWithFolder (transfer: FileUpload): Promise<void> {
|
async uploadOneWithFolder (transfer: FileUpload): Promise<void> {
|
||||||
const savedPath = this.path
|
const savedPath = this.path
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.sftp.stat(path.join(this.path, transfer.getRelativePath()))
|
await this.sftp.stat(path.join(this.path, transfer.getRelativePath()))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user