logo
首页技术栈工具库讨论
tempered

tempered

[Index] For package maintainers and hackage trustees A dead-simple templating utility for simple shell interpolation. Use at your own risk and only on trusted templates. Here's a simple use-case: Then we can render the template with tempered ./post.md to get: If you want you can add a shebang to the top of your template and just run it as an executable, tempered will strip the shebang for you automagically: test.txt Examples Here Mac and Linux binaries are provided HERE; If you're familiar with Haskell Stack: There's really not much to it; parses the file and runs anything inside {{ }} as a shell expression and pipes stdout into its spot. If you're clever you can do pretty much anything you want with this. Sure; It's bash. You can set up environment overrides in env.yaml, tempered looks up through the file-system to find an env.yaml from the cwd NOT the template location. Here's an example env.yaml; we can do simple strings or commands here; just make sure to quote any entries that start with {{ or the YAML parser gets mad. env.yaml Then you can use them just like normal variables. It's bash; go for it: output: Chances are you're forgetting to echo an env-var; {{ $TITLE }} will try to run the contents of $TITLE as a command, you want {{ echo "$TITLE" }}. Probably.
由 
bruceshi2021-01-13 收录
--
推荐
不推荐
更多信息
HACKAGE
carbal install tempered
查看
标签
根据用户添加的标签生成
暂无标签