-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* hotfix/2.1.1: (#728) update omnisharp on every update of cake.bakery (#730) added a new script task
- Loading branch information
Showing
4 changed files
with
78 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
import { commands, window, workspace } from 'vscode'; | ||
import { commands, window } from 'vscode'; | ||
import * as fs from 'fs'; | ||
import { CakeBakery } from './cakeBakery'; | ||
import { logger } from '../shared' | ||
|
||
export async function updateCakeBakeryCommand(extensionPath: string) { | ||
// Make sure that we're in the correct place. | ||
if (workspace.rootPath === undefined) { | ||
window.showErrorMessage('You have not yet opened a folder.'); | ||
return; | ||
} | ||
|
||
// Install Cake Bakery | ||
var result = await installCakeDebug(extensionPath); | ||
var result = await forceInstallBakery(extensionPath); | ||
if (result) { | ||
commands.executeCommand('o.restart'); | ||
window.showInformationMessage( | ||
'Intellisense support for Cake files was installed.' | ||
'Intellisense support (Cake.Bakery) for Cake files was installed.' | ||
); | ||
} else { | ||
window.showErrorMessage( | ||
'Error downloading intellisense support for Cake files.' | ||
'Error downloading intellisense support (Cake.Bakery) for Cake files.' | ||
); | ||
} | ||
} | ||
|
||
export async function installCakeDebug(extensionPath: string): Promise<boolean> { | ||
export async function forceInstallBakery(extensionPath: string): Promise<boolean> { | ||
let bakery = new CakeBakery(extensionPath); | ||
|
||
var targetPath = bakery.getNupkgDestinationPath(); | ||
var targetPath = bakery.getInstallationPath(); | ||
logger.logInfo("Force-updating Cake.Bakery in " + targetPath); | ||
if (fs.existsSync(targetPath)) { | ||
fs.rmdirSync(targetPath, {recursive: true}); | ||
} | ||
|
||
return await bakery.downloadAndExtract(); | ||
const success = await bakery.downloadAndExtract(); | ||
await bakery.updateOmnisharpSettings(); | ||
return success; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters