File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,18 +96,16 @@ export class LogView {
9696 if ( request . text && request . options ?. defaultUri ) {
9797 const defaultWorkspace = ( workspace . workspaceFolders || [ ] ) [ 0 ] ;
9898 const defaultDir = defaultWorkspace ?. uri . path || homedir ( ) ;
99- vscWindow
100- . showSaveDialog ( {
101- defaultUri : Uri . file ( join ( defaultDir , request . options . defaultUri ) ) ,
102- } )
103- . then ( ( fileInfos ) => {
104- if ( fileInfos && request . text ) {
105- writeFile ( fileInfos . path , request . text ) . catch ( ( error ) => {
106- const msg = error instanceof Error ? error . message : String ( error ) ;
107- vscWindow . showErrorMessage ( `Unable to save file: ${ msg } ` ) ;
108- } ) ;
109- }
99+ const destinationFile = await vscWindow . showSaveDialog ( {
100+ defaultUri : Uri . file ( join ( defaultDir , request . options . defaultUri ) ) ,
101+ } ) ;
102+
103+ if ( destinationFile ) {
104+ writeFile ( destinationFile . fsPath , request . text ) . catch ( ( error ) => {
105+ const msg = error instanceof Error ? error . message : String ( error ) ;
106+ vscWindow . showErrorMessage ( `Unable to save file: ${ msg } ` ) ;
110107 } ) ;
108+ }
111109 }
112110 break ;
113111 }
You can’t perform that action at this time.
0 commit comments