okami.mom/albedo
git clone https://git.nkp.pet/okami.mom/albedo
159a58a
main
1//// Deterministic effect gates for helper lifetime tests; never shipped. 2 3import albedo/daemon/storage_cli 4import gleam/erlang/process 5 6@external ( erlang , "albedo_storage_test_support" , "signal" ) 7fn signal ( operation : String , path : String ) -> Nil 8 9pub fn main () -> Nil { 10let assert [ operation , home , path ] = storage_cli . arguments () 11storage_cli . maintain ( 12home , 13fn ( file ) { 14case operation { 15"delete" -> gate ( operation , path ) 16_ -> Nil 17} 18storage_cli . remove ( file ) 19}, 20fn ( file ) { 21case operation { 22"vacuum" -> gate ( operation , path ) 23_ -> Nil 24} 25storage_cli . vacuum ( file ) 26}, 27) 28|> storage_cli . finish 29} 30 31fn gate ( operation : String , path : String ) -> Nil { 32signal ( operation , path ) 33process . sleep_forever () 34}