Skip to content

Commit

Permalink
Added native min os version blocking
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <[email protected]>
  • Loading branch information
paulober committed May 24, 2024
1 parent 1990952 commit 27262ff
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions build/macOS/distribution.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@
<installation-check script="installCheck();"/>
<script>
function installCheck() {
if (!(system.compareVersions(system.version.ProductVersion, '12') &gt;= 0)) {
my.result.title = 'Unable to install';
my.result.message = 'GitHub CLI requires macOS 12 or later.';
my.result.type = 'Fatal';
return false;
}
return true;
// this check is redundant, but it produces a user friendly error message
// compared to a disabled install button caused by allowed-os-versions
if (!(system.compareVersions(system.version.ProductVersion, '12') &gt;= 0)) {
my.result.title = 'Unable to install';
my.result.message = 'GitHub CLI requires macOS 12 or later.';
my.result.type = 'Fatal';
return false;
}
return true;
}
</script>
<allowed-os-versions>
<os-version min="12.0" />
</allowed-os-versions>

<choices-outline>
<line choice="gh-cli"/>
Expand Down

0 comments on commit 27262ff

Please sign in to comment.