Skip to content

Commit

Permalink
fix(parsers): check if vim.fn.has() is 1 (#54)
Browse files Browse the repository at this point in the history
* feat(parsers): move all parsers to their own submodule (#43)

BREAKING CHANGE: Parser modules have been moved

Add `check` functions to all parser modules

* fix: Termux compatible `is_readable_directory` function (#42)

* feat(util): use test command to check directory

* fix: use single quotes in util/file.lua

* feat(util): add type hints and documentation, remove old function

* feat(parsers): move all parsers to their own submodule (#43)

BREAKING CHANGE: Parser modules have been moved

Add `check` functions to all parser modules

* feat(util): use old "readable directory" method when not in Termux

* docs: start adding type definitions

* docs: consistent doc-comment

* fix: error on windows with no battery (#51)

* feat(parsers): move all parsers to their own submodule (#43)

BREAKING CHANGE: Parser modules have been moved

Add `check` functions to all parser modules

* fix: Termux compatible `is_readable_directory` function (#42)

* feat(util): use test command to check directory

* fix: use single quotes in util/file.lua

* feat(util): add type hints and documentation, remove old function

* feat(parsers): move all parsers to their own submodule (#43)

BREAKING CHANGE: Parser modules have been moved

Add `check` functions to all parser modules

* feat(util): use old "readable directory" method when not in Termux

* docs: start adding type definitions

* docs: consistent doc-comment

* fix(parsers/powershell): default to 2 when no batteries

* fix(parsers): check if `vim.fn.has()` is `1`
  • Loading branch information
Agent-E11 authored Sep 8, 2024
1 parent bbee969 commit 5b0fc97
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/battery/parsers/powershell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ end
---Check if this parser would work in the current environment
---@return boolean
function M.check()
return vim.fn.has('win32') and vim.fn.executable('powershell') == 1
return (
vim.fn.has('win32') == 1
and vim.fn.executable('powershell') == 1
)
end

return M

0 comments on commit 5b0fc97

Please sign in to comment.