(List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Removing empty directories from etcd..."]]} ) (FunctionDef cleanup_empty_dirs [] (If (DBracket {B1 UNARY_STRING_n {[ComSub (Com {[VarSub ETCDCTL]} {[LIT_CHARS ls]} {[VarSub 1]})]}}) (For SUBDIR [{[ComSub (Pipeline (Com {[VarSub ETCDCTL]} {[LIT_CHARS ls]} {[LIT_CHARS -p]} {[VarSub 1]}) (Com {[LIT_CHARS grep]} {[DQ [LIT_CHARS /][LIT_OTHER "$"]]}) )]}]) (Com {[LIT_CHARS cleanup_empty_dirs]} {[VarSub SUBDIR]} ) ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Removing empty key "][VarSub 1][LIT_CHARS " ..."]]} ) (Com {[VarSub ETCDCTL]} {[LIT_CHARS rmdir]} {[VarSub 1]} ) ) ) ) (While (Com {[LIT_CHARS true]} ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Starting cleanup..."]]} ) (Com {[LIT_CHARS cleanup_empty_dirs]} {[DQ [LIT_CHARS /registry]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Done with cleanup."]]} ) (Com {[LIT_CHARS sleep]} {[VarSub SLEEP_SECOND]} ) ) ) )