diff options
Diffstat (limited to '')
-rw-r--r-- | docs/luarocks_admin_add.md | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/docs/luarocks_admin_add.md b/docs/luarocks_admin_add.md new file mode 100644 index 00000000..6e15b429 --- /dev/null +++ b/docs/luarocks_admin_add.md | |||
@@ -0,0 +1,53 @@ | |||
1 | # luarocks-admin add | ||
2 | |||
3 | Add a rock or rockspec to a rocks server. | ||
4 | |||
5 | ## Usage | ||
6 | |||
7 | `luarocks-admin add [--server=<server>] [--no-refresh] [--index] {<rockspec>|<rock>}...` | ||
8 | |||
9 | Arguments may be local rockspecs or rock files. The flag `--server` indicates | ||
10 | which server to use. If not given, the default server set in the | ||
11 | `upload_server` variable from the [configuration file](config_file_format.md) | ||
12 | is used instead. You need to either explicitly pass a full URL to `--server` | ||
13 | or configure an upload server in your configuration file prior to using the | ||
14 | `add` command. | ||
15 | |||
16 | Flags: | ||
17 | |||
18 | * `--no-refresh` - The local cache should not be refreshed prior to generation of the updated manifest. | ||
19 | * `--index` - Produce an `index.html` file for the manifest. This flag is automatically set if an `index.html` file already exists. | ||
20 | |||
21 | ## Examples | ||
22 | |||
23 | ### Basic example | ||
24 | |||
25 | Add a rockspec to your default configured upload server: | ||
26 | |||
27 | ``` | ||
28 | luarocks-admin add lpeg-0.9-1.rockspec | ||
29 | ``` | ||
30 | |||
31 | ### Handling multiple repositories | ||
32 | |||
33 | Assuming your `~/.luarocks/config.lua` file looks like this: | ||
34 | |||
35 | ```lua | ||
36 | upload_server = "main" | ||
37 | upload_servers = { | ||
38 | main = { | ||
39 | http = "www.example.com/repos/main", | ||
40 | sftp = "myuser@example.com/var/www/repos/main" | ||
41 | }, | ||
42 | dev = { | ||
43 | http = "www.example.com/repos/devel-rocks", | ||
44 | sftp = "myuser@example.com/var/www/repos/devel-rocks" | ||
45 | }, | ||
46 | } | ||
47 | ``` | ||
48 | |||
49 | you can specify which repository to use with the `--server` flag: | ||
50 | |||
51 | ``` | ||
52 | luarocks-admin add --server=dev my_rock-scm-1.rockspec | ||
53 | ``` | ||