diff --git a/.gitignore b/.gitignore index 0b60dfa..5563c46 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ dist node_modules .vscode-test/ *.vsix +token.txt diff --git a/package.json b/package.json index f6c4a6f..64760a8 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "icon": "images/vcpkg-logo.png", "publisher": "JackBoosY", "license": "MIT", - "version": "2.0.0", + "version": "2.0.1", "engines": { "vscode": "^1.76.0" }, diff --git a/src/settingsDocument.ts b/src/settingsDocument.ts index 4152881..534eb6b 100644 --- a/src/settingsDocument.ts +++ b/src/settingsDocument.ts @@ -38,8 +38,17 @@ export class SettingsDocument { private getDependencyVersion(line: string) { - let tmp = line.indexOf("\"version>=\""); - tmp = tmp + "\"version>=>=\"".length; + let tmp; + if (line.indexOf("\"version>=\"") !== -1) + { + tmp = line.indexOf("\"version>=\""); + tmp = tmp + "\"version>=\"".length; + } + else + { + tmp = line.indexOf("\"version\""); + tmp = tmp + "\"version\"".length; + } let start = line.indexOf("\"", tmp); let end = line.indexOf("\"", start + 1); return line.substring(start + 1, end); @@ -89,7 +98,7 @@ export class SettingsDocument { } tmpName = this.getDependencyName(line); } - else if (line.search("\"version>=\"") !== -1) + else if (line.search("\"version>=\"") !== -1 && line.search("\"version\"") !== -1) { configs.push({name : tmpName, version: this.getDependencyVersion(line)}); tmpName = ""; @@ -122,7 +131,7 @@ export class SettingsDocument { private currentDependencyName(currentLine: string, configText: string,allConfig: Array) { - if (currentLine.search("\"version>=\"") !== -1) + if (currentLine.search("\"version>=\"") !== -1 && currentLine.search("\"version\"") !== -1 ) { let lines = configText.split('\n'); for (let line in lines)