mirror of
https://github.com/godotengine/godot-vscode-plugin.git
synced 2025-12-31 13:48:24 +03:00
improve macOS path resolution for app bundles (#632)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user