1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-09-11 13:13:59 +03:00

fixed #7522, fixed #7577 - sftp: keep permissions when editing file locally

This commit is contained in:
Eugene Pankov 2022-12-03 12:56:55 +01:00
parent fa1649de83
commit 78b17d3980
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
2 changed files with 7 additions and 1 deletions

View File

@ -52,7 +52,8 @@ export class EditSFTPContextMenu extends SFTPContextMenuItemProvider {
if (!upload.length) {
return
}
sftp.upload(item.fullPath, upload[0])
await sftp.upload(item.fullPath, upload[0])
await sftp.chmod(item.fullPath, item.mode)
})).subscribe()
watcher.on('close', () => events.complete())
sftp.closed$.subscribe(() => watcher.close())

View File

@ -138,6 +138,11 @@ export class SFTPSession {
await promisify((f: any) => this.sftp.unlink(p, f))()
}
async chmod (p: string, mode: string|number): Promise<void> {
this.logger.debug('chmod', p, mode)
await promisify((f: any) => this.sftp.chmod(p, mode, f))()
}
async upload (path: string, transfer: FileUpload): Promise<void> {
this.logger.info('Uploading into', path)
const tempPath = path + '.tabby-upload'