Skip to content

Commit cd80f62

Browse files
committed
launchctl: added not laoded for service status
1 parent 86d484b commit cd80f62

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/launchctl/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.8
1+
0.0.9

src/launchctl/launchctl.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ end
134134
function launchctl.get_service_status(label, options)
135135
options = options or {}
136136
local exit_code, stdout, _ = launchctl.exec({ "print", "system/" .. label }, options)
137+
if exit_code ~= 0 and launchctl.is_service_installed(label, options) then
138+
return "not loaded", "" -- service is installed but not loaded
139+
end
137140
assert(exit_code == 0, "failed to get service status for " .. label)
138141

139142
local state = stdout:match("state = ([^\n]+)")

0 commit comments

Comments
 (0)