diff options
author | V1K1NGbg <victor@ilchev.com> | 2024-08-22 17:49:08 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-10-21 13:30:51 -0300 |
commit | 7e45dee34c7683cbe7f7bc7e940aec29c513ed33 (patch) | |
tree | c70cf9ee430bf0eee9ca8c58cbf097ff4a253003 /src | |
parent | 2b14ed6d3906b436a4a58683385001a3bfedb117 (diff) | |
download | luarocks-7e45dee34c7683cbe7f7bc7e940aec29c513ed33.tar.gz luarocks-7e45dee34c7683cbe7f7bc7e940aec29c513ed33.tar.bz2 luarocks-7e45dee34c7683cbe7f7bc7e940aec29c513ed33.zip |
Teal: convert luarocks.admin.cmd.make_manifest
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/admin/cmd/make_manifest.tl (renamed from src/luarocks/admin/cmd/make_manifest.lua) | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/luarocks/admin/cmd/make_manifest.lua b/src/luarocks/admin/cmd/make_manifest.tl index 18f74b5d..8f6efd3c 100644 --- a/src/luarocks/admin/cmd/make_manifest.lua +++ b/src/luarocks/admin/cmd/make_manifest.tl | |||
@@ -1,7 +1,8 @@ | |||
1 | 1 | ||
2 | --- Module implementing the luarocks-admin "make_manifest" command. | 2 | --- Module implementing the luarocks-admin "make_manifest" command. |
3 | -- Compile a manifest file for a repository. | 3 | -- Compile a manifest file for a repository. |
4 | local make_manifest = {} | 4 | local record make_manifest |
5 | end | ||
5 | 6 | ||
6 | local writer = require("luarocks.manif.writer") | 7 | local writer = require("luarocks.manif.writer") |
7 | local index = require("luarocks.admin.index") | 8 | local index = require("luarocks.admin.index") |
@@ -11,7 +12,11 @@ local deps = require("luarocks.deps") | |||
11 | local fs = require("luarocks.fs") | 12 | local fs = require("luarocks.fs") |
12 | local dir = require("luarocks.dir") | 13 | local dir = require("luarocks.dir") |
13 | 14 | ||
14 | function make_manifest.add_to_parser(parser) | 15 | local type Parser = require("luarocks.vendor.argparse").Parser |
16 | |||
17 | local type Args = require("luarocks.core.types.args").Args | ||
18 | |||
19 | function make_manifest.add_to_parser(parser: Parser) | ||
15 | local cmd = parser:command("make_manifest", "Compile a manifest file for a repository.", util.see_also()) | 20 | local cmd = parser:command("make_manifest", "Compile a manifest file for a repository.", util.see_also()) |
16 | 21 | ||
17 | cmd:argument("repository", "Local repository pathname.") | 22 | cmd:argument("repository", "Local repository pathname.") |
@@ -19,13 +24,13 @@ function make_manifest.add_to_parser(parser) | |||
19 | 24 | ||
20 | cmd:flag("--local-tree", "If given, do not write versioned versions of the manifest file.\n".. | 25 | cmd:flag("--local-tree", "If given, do not write versioned versions of the manifest file.\n".. |
21 | "Use this when rebuilding the manifest of a local rocks tree.") | 26 | "Use this when rebuilding the manifest of a local rocks tree.") |
22 | util.deps_mode_option(cmd) | 27 | util.deps_mode_option(cmd as Parser) |
23 | end | 28 | end |
24 | 29 | ||
25 | --- Driver function for "make_manifest" command. | 30 | --- Driver function for "make_manifest" command. |
26 | -- @return boolean or (nil, string): True if manifest was generated, | 31 | -- @return boolean or (nil, string): True if manifest was generated, |
27 | -- or nil and an error message. | 32 | -- or nil and an error message. |
28 | function make_manifest.command(args) | 33 | function make_manifest.command(args: Args): boolean, string |
29 | local repo = args.repository or cfg.rocks_dir | 34 | local repo = args.repository or cfg.rocks_dir |
30 | 35 | ||
31 | util.printout("Making manifest for "..repo) | 36 | util.printout("Making manifest for "..repo) |