4 Commits

Author SHA1 Message Date
github-actions[bot]
329a991bb7 chore(main): release 0.0.3 (#4)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-12-16 01:55:10 +00:00
9a168f9ff9 fix(package): resolve issue with running as a homebrew service 2023-12-16 01:53:29 +00:00
github-actions[bot]
cdac9396fc chore(main): release 0.0.2 (#3)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-12-16 01:39:26 +00:00
993b036d99 fix(battery): find ioreg executable more reliably 2023-12-16 01:36:04 +00:00
4 changed files with 25 additions and 3 deletions

View File

@@ -1,3 +1,3 @@
{
".": "0.0.1"
".": "0.0.3"
}

View File

@@ -39,7 +39,7 @@ brews:
license: "MIT"
skip_upload: auto
service: |
run [bin/"macos-battery-exporter"]
run [bin/"macos-battery-exporter", "-s"]
test: |
system "#{bin}/macos-battery-exporter -v"
repository:

View File

@@ -1,5 +1,19 @@
# Changelog
## [0.0.3](https://github.com/jimeh/macos-battery-exporter/compare/v0.0.2...v0.0.3) (2023-12-16)
### Bug Fixes
* **package:** resolve issue with running as a homebrew service ([9a168f9](https://github.com/jimeh/macos-battery-exporter/commit/9a168f9ff918f6539ca85d43202759197ed952b3))
## [0.0.2](https://github.com/jimeh/macos-battery-exporter/compare/v0.0.1...v0.0.2) (2023-12-16)
### Bug Fixes
* **battery:** find ioreg executable more reliably ([993b036](https://github.com/jimeh/macos-battery-exporter/commit/993b036d99362b6bebd36545fc34d325863421d5))
## 0.0.1 (2023-12-16)

View File

@@ -34,7 +34,15 @@ type batteryRaw struct {
}
func getAllRaw() ([]*batteryRaw, error) {
b, err := exec.Command("ioreg", "-ra", "-c", "AppleSmartBattery").Output()
ioreg, err := exec.LookPath("ioreg")
if err != nil {
ioreg, err = exec.LookPath("/usr/sbin/ioreg")
if err != nil {
return nil, err
}
}
b, err := exec.Command(ioreg, "-ra", "-c", "AppleSmartBattery").Output()
if err != nil {
return nil, err
}