Skip to content

Commit 84669d1

Browse files
authored
Merge pull request #4492 from OmniSharp/bugfix/mono
move the global Mono check to the correct place
2 parents 7c85228 + 78167cd commit 84669d1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/omnisharp/OmniSharpMonoResolver.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,16 @@ export class OmniSharpMonoResolver implements IMonoResolver {
3636

3737
public async getGlobalMonoInfo(options: Options): Promise<MonoInformation> {
3838
let monoInfo = await this.configureEnvironmentAndGetInfo(options);
39-
40-
let isMissing = monoInfo.version === undefined;
41-
if (isMissing) {
42-
const suggestedAction = options.monoPath
43-
? "Update the \"omnisharp.monoPath\" setting to point to the folder containing Mono's '/bin' folder."
44-
: "Ensure that Mono's '/bin' folder is added to your environment's PATH variable.";
45-
throw new Error(`Unable to find Mono. ${suggestedAction}`);
46-
}
47-
4839
let isValid = monoInfo.version && satisfies(monoInfo.version, `>=${this.minimumMonoVersion}`);
4940
if (options.useGlobalMono === "always") {
41+
let isMissing = monoInfo.version === undefined;
42+
if (isMissing) {
43+
const suggestedAction = options.monoPath
44+
? "Update the \"omnisharp.monoPath\" setting to point to the folder containing Mono's '/bin' folder."
45+
: "Ensure that Mono's '/bin' folder is added to your environment's PATH variable.";
46+
throw new Error(`Unable to find Mono. ${suggestedAction}`);
47+
}
48+
5049
if (!isValid) {
5150
throw new Error(`Found Mono version ${monoInfo.version}. Cannot start OmniSharp because Mono version >=${this.minimumMonoVersion} is required.`);
5251
}

0 commit comments

Comments
 (0)