This commit is contained in:
voidlizard 2025-02-21 09:32:22 +03:00
parent ba5e122392
commit ed7f18154f
4 changed files with 28 additions and 16 deletions

View File

@ -38,16 +38,17 @@ keymanEntries = do
entry $ bindMatch "hbs2:keyman:config" $ \_ -> do
mkForm "dict" <$> keymanGetConfig
entry $ bindMatch "hbs2:keyman:keys:add" $ \case
[ LitStrVal ke ] -> do
conf <- keymanGetConfig @C
path <- getDefaultKeyPath conf
let n = hashObject @HbSync (serialise ke) & pretty & show
let fname = n `addExtension` ".key"
let fpath = path </> fname
liftIO $ TIO.writeFile fpath ke
keymanUpdate
pure $ mkStr fpath
args [ arg "string" "keyring-data"] $
entry $ bindMatch "hbs2:keyman:keys:add" $ \case
[ LitStrVal ke ] -> do
conf <- keymanGetConfig @C
path <- getDefaultKeyPath conf
let n = hashObject @HbSync (serialise ke) & pretty & show
let fname = n `addExtension` ".key"
let fpath = path </> fname
liftIO $ TIO.writeFile fpath ke
keymanUpdate
pure $ mkStr fpath
_ -> throwIO (BadFormException @C nil)
_ -> throwIO (BadFormException @C nil)

7
hbs2-git3/bf6/hbs2-git Executable file
View File

@ -0,0 +1,7 @@
#! /usr/bin/env -S bf6 file
(run:proc:attached hbs2-git3 (cdr *args))

View File

@ -133,10 +133,11 @@ compression ; prints compression level
[ StringLike s ] -> display $ mkStr @C (show $ pretty $ gitNormaliseRef (fromString s))
_ -> throwIO (BadFormException @C nil)
entry $ bindMatch "test:hbs2:peer:poke" $ nil_ $ \syn -> do
peer <- getClientAPI @PeerAPI @UNIX
r <- callRpcWaitRetry @RpcPoke (TimeoutSec 0.5) 2 peer () >>= orThrowUser "hbs2-peer not found"
notice $ pretty r
brief "checks if hbs2-peer available"
$ entry $ bindMatch "hbs2:peer:poke" $ nil_ $ \syn -> do
peer <- getClientAPI @PeerAPI @UNIX
r <- callRpcWaitRetry @RpcPoke (TimeoutSec 0.5) 2 peer () >>= orThrowUser "hbs2-peer not found"
notice $ pretty r
hidden do
entry $ bindMatch "git:hash:blob" $ nil_ $ const $ liftIO do

View File

@ -27,5 +27,8 @@ stdenv.mkDerivation {
in ''
mkdir -p $out/bin
cp ${p}/bin/${name} $out/bin
'';
'';
}