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
|
state.db
|
||||||
|
config.local
|
||||||
|
|
|
@ -65,9 +65,7 @@ fixme-comments ";" "--"
|
||||||
(define (backlog s) (modify s workflow :backlog))
|
(define (backlog s) (modify s workflow :backlog))
|
||||||
|
|
||||||
;; refchan settings
|
;; refchan settings
|
||||||
(refchan 3WtddmcE8zzgBAPR7Bu7mKMaVMTN423NNXSPUJp3Hx42)
|
source ./config.local
|
||||||
(reader DTKxNwYCux7zHFLSvmEm5P3Ex21iQrrVdzJpR3giLh1D)
|
|
||||||
(author 3fKeGjaDGBKtNqeNBPsThh8vSj4TPiqaaK7uHbB8MQUV)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -434,9 +434,32 @@ runTop forms = do
|
||||||
|
|
||||||
_ -> void $ lift $ refchanExport ()
|
_ -> void $ lift $ refchanExport ()
|
||||||
|
|
||||||
entry $ bindMatch "fixme:refchan:import" $ nil_ $ const $ lift do
|
entry $ bindMatch "source" $ nil_ $ \case
|
||||||
void $ refchanImport
|
[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
|
entry $ bindMatch "update" $ nil_ $ const $ lift do
|
||||||
refchanUpdate
|
refchanUpdate
|
||||||
|
|
Loading…
Reference in New Issue