Skip to content

Commit

Permalink
escape quotes in generated bootstrap flake
Browse files Browse the repository at this point in the history
  • Loading branch information
tek committed Sep 24, 2023
1 parent afcd092 commit 010b699
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/hix/lib/Hix/Bootstrap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ renderAttrs ind attrs =

renderExpr :: Int -> Expr -> NonEmpty Text
renderExpr ind = \case
ExprString s -> indent ind [[exon|"#{s}"|]]
ExprString s -> indent ind [[exon|"#{Text.replace "\"" "\\\"" s}"|]]
ExprLit e -> [e]
ExprList l -> "[" :| (indent (ind + 2) (toList . renderExpr ind =<< l)) ++ ["]"]
ExprAttrs a -> case renderAttrs ind a of
Expand Down
4 changes: 2 additions & 2 deletions packages/hix/test/Hix/Test/BootstrapTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cabal =

name: red-panda
version: 0.1.0.0
synopsis: A Haskell project
synopsis: A Haskell "project"
description: See https://hackage.haskell.org/package/red-panda/docs/RedPanda.html
author: Panda
maintainer: Panda
Expand Down Expand Up @@ -105,7 +105,7 @@ flakeTarget =
license-file = "LICENSE";
meta = {
maintainer = "Panda";
synopsis = "A Haskell project";
synopsis = "A Haskell \"project\"";
};
};
library = {
Expand Down

0 comments on commit 010b699

Please sign in to comment.