forked from dan/liminix
tidy watch-outputs startup message
This commit is contained in:
parent
32bf80c6fa
commit
bcf5ab24e8
@ -1,4 +1,4 @@
|
|||||||
(local { : system : assoc : split : table= : dig } (require :anoia))
|
(local { : %% : system : assoc : split : table= : dig } (require :anoia))
|
||||||
(local svc (require :anoia.svc))
|
(local svc (require :anoia.svc))
|
||||||
(local { : view } (require :fennel))
|
(local { : view } (require :fennel))
|
||||||
(local { : kill } (require :lualinux))
|
(local { : kill } (require :lualinux))
|
||||||
@ -27,8 +27,6 @@
|
|||||||
_ path (ipairs paths)]
|
_ path (ipairs paths)]
|
||||||
(or changed? (not (table= (dig old-tree path) (dig new-tree path))))))
|
(or changed? (not (table= (dig old-tree path) (dig new-tree path))))))
|
||||||
|
|
||||||
(fn %% [fmt ...] (string.format fmt ...))
|
|
||||||
|
|
||||||
(fn do-action [action service]
|
(fn do-action [action service]
|
||||||
(case action
|
(case action
|
||||||
:restart (system (%% "s6-svc -r /run/service/%s" service))
|
:restart (system (%% "s6-svc -r /run/service/%s" service))
|
||||||
@ -42,9 +40,8 @@
|
|||||||
: watched-service
|
: watched-service
|
||||||
: paths } (parse-args arg)
|
: paths } (parse-args arg)
|
||||||
dir (.. watched-service "/.outputs")
|
dir (.. watched-service "/.outputs")
|
||||||
_ (print :service-dir dir)
|
|
||||||
service (assert (svc.open dir))]
|
service (assert (svc.open dir))]
|
||||||
(print "watching " watched-service)
|
(print (%% "watching %q" watched-service))
|
||||||
(accumulate [tree (service:output ".")
|
(accumulate [tree (service:output ".")
|
||||||
v (service:events)]
|
v (service:events)]
|
||||||
(let [new-tree (service:output ".")]
|
(let [new-tree (service:output ".")]
|
||||||
|
Loading…
Reference in New Issue
Block a user