Skip to content
This repository was archived by the owner on Dec 28, 2024. It is now read-only.

Commit de55935

Browse files
committed
add standalone to cli
1 parent 35e0f72 commit de55935

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Added `include_entry` option
1313
- Added `packer:export()`
14+
- Added standalone option for CLI
15+
- reads module names line for line and then includes them
1416

1517
### Changed
1618

luapack.yue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,16 @@ cli = (arguments) ->
239239
continue if "-" == filename::sub 1, 1
240240
print "Packing #{filename}"
241241
packer = Packer options
242-
packer::pack filename
242+
243+
if options.standalone
244+
local content
245+
with io.open filename, "r"
246+
content = ::read "*a"
247+
::close!
248+
packer::include name for name in content::gmatch "[^\n]+"
249+
else
250+
packer::pack filename
251+
243252
packed = packer::export!
244253
outfile = filename::gsub "%.(%a+)$", (x) -> ".packed.lua"
245254
print "Packed into #{outfile}"

0 commit comments

Comments
 (0)