diff --git a/Makefile b/Makefile index a702b667..63d08110 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,6 @@ BINS := \ hbs2-keyman \ hbs2-git-subscribe \ git-remote-hbs2 \ - git-hbs2 \ hbs2-cli \ hbs2-sync \ fixme-new \ diff --git a/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs b/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs index e2a65e80..671306d3 100644 --- a/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs +++ b/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs @@ -1522,6 +1522,21 @@ internalEntries = do _ -> throwIO (BadFormException @c nil) + let dropShebang = id + + -- skips shebang + entry $ bindMatch "top:file:run" $ nil_ $ \case + (StringLike fn : args) -> do + liftIO (TIO.readFile fn) + <&> either (error.show) (fmap (fixContext @C @c) . dropShebang ) . parseTop + <&> \case + (ListVal (SymbolVal "#!" : _) : rest) -> rest + rest -> rest + >>= evalTop + + _ -> throwIO (BadFormException @c nil) + + brief "parses string as toplevel and produces a form" $ desc "parse:top:string SYMBOL STRING-LIKE" $ entry $ bindMatch "parse:top:string" $ \case