teal-language/cyan

Add support for teal's `--keep-hashbang` compiler option in `build` and `gen`

Open

#70 创建于 2026年2月20日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)Lua (12 fork)auto 404
feature requestgood first issue

仓库指标

Star
 (125 star)
PR 合并指标
 (PR 指标待抓取)

描述

Context

I'm building a Lua library to use with Redis Functions. The Lua script must start with a shebang to define metadata, such as the engine to use and the library's name. E.g.

#!lua name=mylib
redis.register_function(
  'knockknock',
  function() return 'Who\'s there?' end
)

which can be loaded in Redis with:

redis-cli  FUNCTION LOAD "$(cat ./build/main.lua)"

Problem

Teal's compiler options supports the --keep-hashbang flag to preserve the shebang at the top of the file. However, this option is missing in cyan's build and gen commands.

It would be nice to support this option in cyan, so we don't have to prepend it post build.

Appreciate all the work, enjoyed using cyan for the first time 🙏🏻

贡献者指南