diff --git a/src/utils/project_utils.ts b/src/utils/project_utils.ts index 36855537..cdcd2738 100644 --- a/src/utils/project_utils.ts +++ b/src/utils/project_utils.ts @@ -1,6 +1,7 @@ import * as vscode from "vscode"; import * as path from "path"; import * as fs from "fs"; +import * as os from "os"; import { execSync } from "child_process"; import { get_configuration } from "./vscode_utils"; @@ -109,6 +110,10 @@ type VERIFY_RESULT = { export function verify_godot_version(godotPath: string, expectedVersion: "3" | "4" | string): VERIFY_RESULT { try { + if (os.platform() === 'darwin' && godotPath.endsWith('.app')) { + godotPath = path.join(godotPath, 'Contents', 'MacOS', 'Godot'); + } + const output = execSync(`"${godotPath}" --version`).toString().trim(); const pattern = /^(([34])\.([0-9]+)(?:\.[0-9]+)?)/m; const match = output.match(pattern);