From 409293d564a65ae588fd528b07039e6f2d0ffa69 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 21 Jan 2019 08:31:08 -0800 Subject: [PATCH] fix #66824 --- .../electron-browser/remoteFileService.ts | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/services/files/electron-browser/remoteFileService.ts b/src/vs/workbench/services/files/electron-browser/remoteFileService.ts index da6dfd249e4..80078b6cade 100644 --- a/src/vs/workbench/services/files/electron-browser/remoteFileService.ts +++ b/src/vs/workbench/services/files/electron-browser/remoteFileService.ts @@ -563,17 +563,19 @@ export class RemoteFileService extends FileService { : Promise.resolve(null); return prepare.then(() => this._withProvider(source)).then(RemoteFileService._throwIfFileSystemIsReadonly).then(provider => { - return provider.rename(source, target, { overwrite }).then(() => { - return this.resolveFile(target); - }).then(fileStat => { - this._onAfterOperation.fire(new FileOperationEvent(source, FileOperation.MOVE, fileStat)); - return fileStat; - }, err => { - const result = this._tryParseFileOperationResult(err); - if (result === FileOperationResult.FILE_MOVE_CONFLICT) { - throw new FileOperationError(localize('fileMoveConflict', "Unable to move/copy. File already exists at destination."), result); - } - throw err; + return RemoteFileService._mkdirp(provider, resources.dirname(target)).then(() => { + return provider.rename(source, target, { overwrite }).then(() => { + return this.resolveFile(target); + }).then(fileStat => { + this._onAfterOperation.fire(new FileOperationEvent(source, FileOperation.MOVE, fileStat)); + return fileStat; + }, err => { + const result = this._tryParseFileOperationResult(err); + if (result === FileOperationResult.FILE_MOVE_CONFLICT) { + throw new FileOperationError(localize('fileMoveConflict', "Unable to move/copy. File already exists at destination."), result); + } + throw err; + }); }); }); } -- GitLab