Adjust Godot version detection regex (#526)

* Adjust Godot version detection regex

Signed-off-by: mlsvrts <mlsvrts@protonmail.com>
This commit is contained in:
mlsvrts
2023-11-12 12:44:52 -07:00
committed by GitHub
parent a4c1181894
commit f65033c626
4 changed files with 4 additions and 4 deletions

View File

@@ -109,7 +109,7 @@ export class ServerController {
try {
log.info(`Verifying version of '${godotPath}'`);
const output = execSync(`${godotPath} --version`).toString().trim();
const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?\w+.\w+.[0-9a-f]{9}/;
const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?(?:\w+\.)+[0-9a-f]{9}/;
const match = output.match(pattern);
if (!match) {
const message = `Cannot launch debug session: '${settingName}' of '${godotPath}' is not a valid Godot executable`;

View File

@@ -110,7 +110,7 @@ export class ServerController {
try {
log.info(`Verifying version of '${godotPath}'`);
const output = execSync(`${godotPath} --version`).toString().trim();
const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?\w+.\w+.[0-9a-f]{9}/;
const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?(?:\w+\.)+[0-9a-f]{9}/;
const match = output.match(pattern);
if (!match) {
const message = `Cannot launch debug session: '${settingName}' of '${godotPath}' is not a valid Godot executable`;

View File

@@ -93,7 +93,7 @@ function open_workspace_with_editor() {
try {
const output = execSync(`${godotPath} --version`).toString().trim();
const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?\w+.\w+.[0-9a-f]{9}/;
const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?(?:\w+\.)+[0-9a-f]{9}/;
const match = output.match(pattern);
if (!match) {
const message = `Cannot launch Godot editor: '${settingName}' of '${godotPath}' is not a valid Godot executable`;

View File

@@ -110,7 +110,7 @@ export class ClientConnectionManager {
try {
const output = execSync(`${godotPath} --version`).toString().trim();
const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?\w+.\w+.[0-9a-f]{9}/;
const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?(?:\w+\.)+[0-9a-f]{9}/;
const match = output.match(pattern);
if (!match) {
const message = `Cannot launch headless LSP: '${settingName}' of '${godotPath}' is not a valid Godot executable`;