A standalone Luau runtime
Find a file
2023-01-19 14:15:32 -05:00
.github/workflows Implement downloading of type definition files in CLI 2023-01-19 13:18:15 -05:00
.lune Add support for script args 2023-01-19 00:23:06 -05:00
.vscode Fix clippy lints 2023-01-18 21:11:47 -05:00
src Implement downloading of type definition files in CLI 2023-01-19 13:18:15 -05:00
.gitignore Initial commit 2023-01-18 20:47:14 -05:00
.luaurc Initial commit 2023-01-18 20:47:14 -05:00
aftman.toml Initial commit 2023-01-18 20:47:14 -05:00
Cargo.lock Implement downloading of type definition files in CLI 2023-01-19 13:18:15 -05:00
Cargo.toml Implement downloading of type definition files in CLI 2023-01-19 13:18:15 -05:00
CHANGELOG.md Add changelog 2023-01-19 13:28:01 -05:00
LICENSE.txt Add readme, license, cargo metadata 2023-01-18 21:19:10 -05:00
lune.yml Initial commit 2023-01-18 20:47:14 -05:00
luneTypes.d.luau Initial commit 2023-01-18 20:47:14 -05:00
README.md Add readme contents 2023-01-19 14:15:32 -05:00
selene.toml Initial commit 2023-01-18 20:47:14 -05:00
stylua.toml Initial commit 2023-01-18 20:47:14 -05:00

Lune 🌙

CI Release

A Luau script runner


🚀 Use the ergonomics and readability of Luau instead of shell scripts 🚀

Full example & walkthrough

Example translation from Bash to Luau

Before:

#!/bin/bash
VALID=true
COUNT=1
while [ $VALID ]
do
    echo $COUNT
    if [ $COUNT -eq 5 ];
    then
        break
    fi
    ((COUNT++))
done

After:

local valid = true
local count = 1
while valid do
    print(count)
    if count == 5 then
        break
    end
    count += 1
end

⚙️ Installation

Using Aftman

The preferred way of installing Lune.

This will add lune to an aftman.toml file in the current directory, or create one if it does not exist.

$ aftman add filiptibell/lune

From GitHub Releases

You can also download pre-built binaries for most systems directly from the linked GitHub Releases page.

✏️ Writing Lune Scripts

First things first, check out the examples of how to write a script in the .lune folder!
Lune has many useful built-in globals and APIs to use to interact with your system, and can do things such as read/write files, run external programs, serialize & deserialize json, and much more.

🏃 Running Lune Scripts

When you've written a script with either a .lua or .luau extension, you can run it:

$ lune script-name

This will look for the script script_name 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

If you don't want Lune to look in sub-directories you can provide a full file path with the file extension included, instead of only the file name.