Skip to content

Commit

Permalink
properly detect windows 10
Browse files Browse the repository at this point in the history
  • Loading branch information
brajjan committed Feb 11, 2025
1 parent 7ea6587 commit 49ef59e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/facter/util/facts/windows_release_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ def find_release(input)

def check_version_10_11(consumerrel, kernel_version)
build_number = kernel_version[/([^.]*)$/].to_i

return '11' if consumerrel && build_number >= 22_000
return '10' if consumerrel && build_number >= 20_348
return '10' if consumerrel && build_number >= 10_240

if build_number >= 26_100
'2025'
elsif build_number >= 20_348
'2022'
elsif build_number >= 17_623
elsif build_number >= 17_763
'2019'
else
'2016'
Expand Down
2 changes: 1 addition & 1 deletion spec/facter/util/facts/windows_release_finder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
describe '#find windows release when version is 10' do
let(:cons) { true }
let(:desc) {}
let(:k_version) { '10.0.123' }
let(:k_version) { '10.0.10240' }
let(:version) { '10.0' }

it 'returns 10' do
Expand Down

0 comments on commit 49ef59e

Please sign in to comment.