2023-07-23 14:45:28 +01:00
|
|
|
# Command-Line Usage
|
2023-07-22 13:25:44 +01:00
|
|
|
|
2023-07-23 14:45:28 +01:00
|
|
|
## Running Scripts
|
2023-07-22 13:25:44 +01:00
|
|
|
|
2023-07-23 14:45:28 +01:00
|
|
|
When you've written a script file, for example `script-name.luau`, you can run it as such:
|
2023-07-22 13:25:44 +01:00
|
|
|
|
|
|
|
```sh copy
|
2024-01-14 18:07:03 +00:00
|
|
|
lune run script-name
|
2023-07-22 13:25:44 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
This will look for the file `script-name.luau`**_<sup>[1]</sup>_** in a few locations:
|
|
|
|
|
|
|
|
- The current directory
|
|
|
|
- The folder `lune` in the current directory, if it exists
|
|
|
|
- The folder `.lune` in the current directory, if it exists
|
|
|
|
- The folder `lune` in the _home_ directory, if it exists
|
|
|
|
- The folder `.lune` in the _home_ directory, if it exists
|
|
|
|
|
2023-07-23 14:45:28 +01:00
|
|
|
## Listing Scripts
|
2023-07-22 13:25:44 +01:00
|
|
|
|
|
|
|
```sh copy
|
2024-01-14 18:07:03 +00:00
|
|
|
lune list
|
2023-07-22 13:25:44 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Lists all scripts found in `lune` or `.lune` directories, including any top-level description
|
|
|
|
comments. <br /> Lune description comments are always written at the top of a file and start with a
|
|
|
|
lua-style comment arrow (`-->`).
|
|
|
|
|
2023-07-23 14:45:28 +01:00
|
|
|
## Advanced Usage
|
|
|
|
|
2023-07-22 13:25:44 +01:00
|
|
|
```sh copy
|
2024-01-14 18:07:03 +00:00
|
|
|
lune run -
|
2023-07-22 13:25:44 +01:00
|
|
|
```
|
|
|
|
|
2023-07-23 14:45:28 +01:00
|
|
|
Runs a script passed to Lune using stdin. Useful for running scripts piped to Lune from external
|
|
|
|
sources. Example:
|
|
|
|
|
|
|
|
```sh copy
|
2024-01-14 18:07:03 +00:00
|
|
|
echo "print 'Hello, terminal!'" | lune run -
|
2023-07-23 14:45:28 +01:00
|
|
|
```
|
2023-07-22 13:25:44 +01:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
**_<sup>[1]</sup>_** _Lune also supports files with the `.lua` extension but using the `.luau`
|
|
|
|
extension is highly recommended. Additionally, if you don't want Lune to look in sub-directories or
|
|
|
|
try to find files with `.lua` / `.luau` extensions at all, you can provide an absolute file path.
|
|
|
|
This will disable all file path parsing and checks, and just run the file directly._
|