Merge pull request #6977 from urbit/yu/commit-event

gen: add +commit-event
This commit is contained in:
Pyry Kovanen 2024-05-24 18:49:08 +03:00 committed by GitHub
commit 7d2b3e10ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,17 @@
:: make a unix commit event
::
:: call as > .event/jam +commit-event /path/to/file
:: to be used with ./urbit-binary -I event.jam pier
::
:: XX expand with arbitrary user-defined events?
:: XX only supports files in which +noun:grab in the mark file returns a @t
:: (e.g. hoon files)
::
:- %say
|= [[now=@da eny=@uvJ bec=beak] [=path ~] ~]
:- %noun
?~ beam=(de-beam path)
~|(%path-not-beam !!)
=+ .^(file=@t %cx path)
=+ .^(=tube:clay %cc /(scot %p p.bec)/[q.bec]/(scot %da now)/txt/mime)
[/c/sync %into desk=q.u.beam | [s.u.beam [~ !<(mime (tube !>(~[file])))]]~]