mirror of https://github.com/voidlizard/hbs2
added source function to add per-user configs
This commit is contained in:
parent
ff9ef2ddec
commit
84f801e6d6
|
@ -1 +1,2 @@
|
|||
state.db
|
||||
config.local
|
||||
|
|
|
@ -65,9 +65,7 @@ fixme-comments ";" "--"
|
|||
(define (backlog s) (modify s workflow :backlog))
|
||||
|
||||
;; refchan settings
|
||||
(refchan 3WtddmcE8zzgBAPR7Bu7mKMaVMTN423NNXSPUJp3Hx42)
|
||||
(reader DTKxNwYCux7zHFLSvmEm5P3Ex21iQrrVdzJpR3giLh1D)
|
||||
(author 3fKeGjaDGBKtNqeNBPsThh8vSj4TPiqaaK7uHbB8MQUV)
|
||||
source ./config.local
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -434,9 +434,32 @@ runTop forms = do
|
|||
|
||||
_ -> void $ lift $ refchanExport ()
|
||||
|
||||
entry $ bindMatch "fixme:refchan:import" $ nil_ $ const $ lift do
|
||||
void $ refchanImport
|
||||
entry $ bindMatch "source" $ nil_ $ \case
|
||||
[StringLike path] -> do
|
||||
|
||||
ppath <- if List.isPrefixOf "." path then do
|
||||
dir <- localConfigDir
|
||||
let rest = tail $ splitDirectories path
|
||||
pure $ joinPath (dir:rest)
|
||||
else do
|
||||
canonicalizePath path
|
||||
|
||||
debug $ red "SOURCE FILE" <+> pretty ppath
|
||||
|
||||
dd <- readTVarIO tvd
|
||||
|
||||
-- FIXME: raise-warning?
|
||||
content <- liftIO $ try @_ @IOException (readFile ppath)
|
||||
<&> fromRight mempty
|
||||
<&> parseTop
|
||||
>>= either (error.show) pure
|
||||
|
||||
lift $ run dd content
|
||||
|
||||
_ -> throwIO $ BadFormException @C nil
|
||||
|
||||
entry $ bindMatch "update" $ nil_ $ const $ lift do
|
||||
refchanUpdate
|
||||
|
||||
entry $ bindMatch "update" $ nil_ $ const $ lift do
|
||||
refchanUpdate
|
||||
|
|
Loading…
Reference in New Issue