File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change
1
+ Have the new export commands use our directory change code
Original file line number Diff line number Diff line change @@ -134,7 +134,13 @@ export class HistoryCommandListener implements IDataScienceCommandListener {
134
134
135
135
await this . waitForStatus ( async ( ) => {
136
136
if ( uri ) {
137
- const notebook = await this . jupyterExporter . translateToNotebook ( cells ) ;
137
+ let directoryChange ;
138
+ const settings = this . configuration . getSettings ( ) ;
139
+ if ( settings . datascience . changeDirOnImportExport ) {
140
+ directoryChange = uri . fsPath ;
141
+ }
142
+
143
+ const notebook = await this . jupyterExporter . translateToNotebook ( cells , directoryChange ) ;
138
144
await this . fileSystem . writeFile ( uri . fsPath , JSON . stringify ( notebook ) ) ;
139
145
}
140
146
} , localize . DataScience . exportingFormat ( ) , file ) ;
@@ -218,7 +224,12 @@ export class HistoryCommandListener implements IDataScienceCommandListener {
218
224
} ) ) ) ;
219
225
220
226
// Then save them to the file
221
- const notebook = await this . jupyterExporter . translateToNotebook ( cells ) ;
227
+ let directoryChange ;
228
+ if ( settings . datascience . changeDirOnImportExport ) {
229
+ directoryChange = file ;
230
+ }
231
+
232
+ const notebook = await this . jupyterExporter . translateToNotebook ( cells , directoryChange ) ;
222
233
await this . fileSystem . writeFile ( file , JSON . stringify ( notebook ) ) ;
223
234
224
235
} finally {
You can’t perform that action at this time.
0 commit comments