mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
folderUrl pointing to the contribution file that's created inside the picked folder (#6495)
This commit is contained in:
@@ -87,8 +87,9 @@ async function promptForFolder(bookContribution: BookContribution): Promise<void
|
|||||||
});
|
});
|
||||||
if (uris && uris.length > 0) {
|
if (uris && uris.length > 0) {
|
||||||
let pickedFolder = uris[0];
|
let pickedFolder = uris[0];
|
||||||
await saveBooksToFolder(pickedFolder, bookContribution);
|
let destinationUri: vscode.Uri = vscode.Uri.file(path.join(pickedFolder.fsPath, bookContribution.name));
|
||||||
await promptToReloadWindow(pickedFolder);
|
await saveBooksToFolder(destinationUri, bookContribution);
|
||||||
|
await promptToReloadWindow(destinationUri);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -100,12 +101,10 @@ async function saveBooksToFolder(folderUri: vscode.Uri, bookContribution: BookCo
|
|||||||
// Get book contributions
|
// Get book contributions
|
||||||
if (bookContribution && folderUri) {
|
if (bookContribution && folderUri) {
|
||||||
//remove folder if exists
|
//remove folder if exists
|
||||||
await fs.removeSync(path.join(folderUri.fsPath, bookContribution.name));
|
await fs.removeSync(folderUri.fsPath);
|
||||||
//copy them from the books extension:
|
|
||||||
const destinationFolder = path.join(folderUri.fsPath, bookContribution.name);
|
|
||||||
//make directory for each contribution book.
|
//make directory for each contribution book.
|
||||||
fs.mkdirSync(destinationFolder);
|
await fs.mkdirSync(folderUri.fsPath);
|
||||||
await fs.copy(bookContribution.path, destinationFolder);
|
await fs.copy(bookContribution.path, folderUri.fsPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function promptToReloadWindow(folderUri: vscode.Uri): void {
|
function promptToReloadWindow(folderUri: vscode.Uri): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user