From 3d1cb5e20f7a05314f6fd4261076b0a85546cfe4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 19 Mar 2020 09:32:57 +0100 Subject: Simplify extension tag sniffing --- editors/code/src/config.ts | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'editors/code/src/config.ts') diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 28698ab8e..54b905303 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -38,23 +38,17 @@ export class Config { ] .map(opt => `${this.rootSection}.${opt}`); - readonly packageJsonVersion = vscode + readonly packageJsonVersion: string = vscode .extensions .getExtension(this.extensionId)! .packageJSON - .version as string; // n.n.YYYYMMDD[-nightly] + .version; - /** - * Either `nightly` or `YYYY-MM-DD` (i.e. `stable` release) - */ - readonly extensionReleaseTag: string = (() => { - if (this.packageJsonVersion.endsWith(NIGHTLY_TAG)) return NIGHTLY_TAG; - - const realVersionRegexp = /^\d+\.\d+\.(\d{4})(\d{2})(\d{2})/; - const [, yyyy, mm, dd] = this.packageJsonVersion.match(realVersionRegexp)!; - - return `${yyyy}-${mm}-${dd}`; - })(); + readonly releaseTag: string = vscode + .extensions + .getExtension(this.extensionId)! + .packageJSON + .releaseTag; private cfg!: vscode.WorkspaceConfiguration; -- cgit v1.2.3