Skip to content

Commit

Permalink
Fix bug with os detection
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Apr 19, 2024
1 parent 8a33ad4 commit f9e3309
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

- Fixed bug with OS detection introduced by 6ffd1964500d24c1adde3c88705b146d9c415207.

## [v3.7.9](https://github.com/epwalsh/obsidian.nvim/releases/tag/v3.7.9) - 2024-04-18

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions lua/obsidian/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,9 @@ util.get_os = function()
if vim.fn.has "win32" == 1 then
this_os = util.OSType.Windows
else
local sysname = vim.loop.os_uname().sysname:lower()
local sysname = vim.loop.os_uname().sysname
local release = vim.loop.os_uname().release:lower()
if sysname == "linux" and string.find(release, "microsoft") then
if sysname:lower() == "linux" and string.find(release, "microsoft") then
this_os = util.OSType.Wsl
else
this_os = sysname
Expand Down

1 comment on commit f9e3309

@amw1lson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduces a bug since the enum table contains capitalized OS name strings but line 445 sets the enum to the (now) lowercase sysname.

Please sign in to comment.