Prepare beta extension (#218)
* Updated changelog. Improved sign off docs due to DCO Check usage. Signed-off-by: Jerome Luckenbach <github@luckenba.ch> * Prepare for a later beta extension. Signed-off-by: Jerome Luckenbach <github@luckenba.ch> * Fix extension name. Signed-off-by: Jerome Luckenbach <github@luckenba.ch> * Prevent beta from getting deactivated too. Signed-off-by: Jerome Luckenbach <github@luckenba.ch>pull/219/head
parent
1d2bd40d65
commit
0689d1f721
|
@ -3,6 +3,7 @@
|
||||||
import {
|
import {
|
||||||
commands,
|
commands,
|
||||||
Disposable,
|
Disposable,
|
||||||
|
extensions,
|
||||||
ExtensionContext,
|
ExtensionContext,
|
||||||
languages,
|
languages,
|
||||||
window,
|
window,
|
||||||
|
@ -29,7 +30,7 @@ import { HoverProvider } from './HoverProvider/HoverProvider'
|
||||||
import * as _ from 'lodash'
|
import * as _ from 'lodash'
|
||||||
import * as ncp from 'copy-paste'
|
import * as ncp from 'copy-paste'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import { SSL_OP_EPHEMERAL_RSA } from 'constants'
|
import * as fs from 'fs'
|
||||||
|
|
||||||
let _extensionPath: string
|
let _extensionPath: string
|
||||||
let ohStatusBarItem: StatusBarItem
|
let ohStatusBarItem: StatusBarItem
|
||||||
|
@ -206,6 +207,16 @@ async function init(disposables: Disposable[], config, context): Promise<void> {
|
||||||
// This method is called when the extension is activated
|
// This method is called when the extension is activated
|
||||||
export function activate(context: ExtensionContext) {
|
export function activate(context: ExtensionContext) {
|
||||||
|
|
||||||
|
// Keep the stable extension deactivated, when beta version is installed
|
||||||
|
let thisExtension = JSON.parse(fs.readFileSync(path.join(context.extensionPath, "package.json"), 'utf8')).name
|
||||||
|
let betaExtension = extensions.getExtension('openhab.openhab-beta')
|
||||||
|
|
||||||
|
// When beta is available and we are not beta itself, this extension should not get activated
|
||||||
|
if(betaExtension !== undefined && thisExtension !== "openhab-beta"){
|
||||||
|
console.log(`openHAB vscode extension stays deactivated.\nDetected an installed beta version.`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Prepare disposables array, context and config
|
// Prepare disposables array, context and config
|
||||||
const disposables: Disposable[] = []
|
const disposables: Disposable[] = []
|
||||||
_extensionPath = context.extensionPath
|
_extensionPath = context.extensionPath
|
||||||
|
|
Loading…
Reference in New Issue