Skip to content
Snippets Groups Projects
Commit 435e5efe authored by Alexander Turenko's avatar Alexander Turenko Committed by Igor Munkin
Browse files

lua: load scripts or modules pointed by env var

Fixes #7714

@TarantoolBot document
Title: TT_PRELOAD

A script file or a module may be specified in the `TT_PRELOAD`
environment variable to load before the main script. For example:

```shell
$ TT_PRELOAD=/path/to/foo.lua tarantool main.lua
```

The `foo.lua` script will be executed before `main.lua`.

```shell
$ TT_PRELOAD=foo.bar.baz tarantool main.lua
```

The `foo.bar.baz` module will be loaded before executing `main.lua`.

A value that ends with `.lua` is considered as a script file, otherwise
it is considered as a module name.

Several files or modules may be passed as a semicolon separated list:

```shell
$ TT_PRELOAD="/path/to/foo.lua;foo.bar.baz" tarantool main.lua
```

Don't forget quotes, a shell interprets a semicolon on its own.

Redundant (duplicated, leading, trailing) semicolons are ignored.

If something goes wrong at script/module execution, tarantool reports
the problem and exits.

A script receives a path to the file in `...`, a module gets the module
name. `arg` is the same as for the main script.
parent e5704327
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment