Skip to content

Commit

Permalink
Adjust Godot version detection regex (#526)
Browse files Browse the repository at this point in the history
* Adjust Godot version detection regex

Signed-off-by: mlsvrts <[email protected]>
  • Loading branch information
mlsvrts authored Nov 12, 2023
1 parent a4c1181 commit f65033c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/debugger/godot3/server_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/godot4/server_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
2 changes: 1 addition & 1 deletion src/lsp/ClientConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down

0 comments on commit f65033c

Please sign in to comment.