diff --git a/tabby-electron/src/sftpContextMenu.ts b/tabby-electron/src/sftpContextMenu.ts index 24a42c05..29204748 100644 --- a/tabby-electron/src/sftpContextMenu.ts +++ b/tabby-electron/src/sftpContextMenu.ts @@ -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()) diff --git a/tabby-ssh/src/session/sftp.ts b/tabby-ssh/src/session/sftp.ts index b85a41a5..79d136f0 100644 --- a/tabby-ssh/src/session/sftp.ts +++ b/tabby-ssh/src/session/sftp.ts @@ -138,6 +138,11 @@ export class SFTPSession { await promisify((f: any) => this.sftp.unlink(p, f))() } + async chmod (p: string, mode: string|number): Promise { + this.logger.debug('chmod', p, mode) + await promisify((f: any) => this.sftp.chmod(p, mode, f))() + } + async upload (path: string, transfer: FileUpload): Promise { this.logger.info('Uploading into', path) const tempPath = path + '.tabby-upload'