mirror of
https://github.com/urbit/shrub.git
synced 2024-12-18 15:55:00 +03:00
Merge pull request #5360 from urbit/m/new-desk
gen: add |new-desk for creating minimal desks
This commit is contained in:
commit
3eda93cac3
50
pkg/arvo/gen/hood/new-desk.hoon
Normal file
50
pkg/arvo/gen/hood/new-desk.hoon
Normal file
@ -0,0 +1,50 @@
|
||||
:: |new-desk: creates a minimal desk
|
||||
::
|
||||
/+ *generators
|
||||
::
|
||||
:- %ask
|
||||
|= $: [now=@da eny=@uvJ bek=beak]
|
||||
[=desk ~]
|
||||
[from=$~(%base desk) hard=_|]
|
||||
==
|
||||
::
|
||||
=; make-new-desk
|
||||
?. ?& !hard
|
||||
(~(has in .^((set ^desk) %cd (en-beam bek(q %$) /))) desk)
|
||||
==
|
||||
(make-new-desk)
|
||||
%+ print (rap 3 'the desk %' desk ' already exists. overwrite it?' ~)
|
||||
%+ prompt [%& %prompt "overwrite? (y/N) "]
|
||||
|= in=tape
|
||||
?. |(=("y" in) =("Y" in) =("yes" in))
|
||||
no-product
|
||||
(make-new-desk)
|
||||
::
|
||||
|. %- produce
|
||||
:- %helm-pass
|
||||
%^ new-desk:cloy desk
|
||||
~
|
||||
%- ~(gas by *(map path page:clay))
|
||||
|^ =- (turn - mage)
|
||||
^- (list path)
|
||||
:~ /mar/noun/hoon
|
||||
/mar/hoon/hoon
|
||||
/mar/txt/hoon
|
||||
/mar/kelvin/hoon
|
||||
/sys/kelvin
|
||||
==
|
||||
::
|
||||
++ mage
|
||||
|= =path
|
||||
:- path
|
||||
^- page:clay
|
||||
:- (rear path)
|
||||
~| [%missing-source-file from path]
|
||||
.^ *
|
||||
%cx
|
||||
(scot %p p.bek)
|
||||
from
|
||||
(scot %da now)
|
||||
path
|
||||
==
|
||||
--
|
Loading…
Reference in New Issue
Block a user