Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There should be a simple global function used to determine if the script is running on Lune or not #31

Closed
zaiisao opened this issue Apr 14, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@zaiisao
Copy link

zaiisao commented Apr 14, 2023

Some code may be designed to run on both Roblox and on Lune. Right now the cleanest way to determine if the script is running on Lune is to do something like if pcall(require, "@lune/fs") then which is what I'm doing now, but this seems a bit messy.

@filiptibell filiptibell added the enhancement New feature or request label Apr 14, 2023
@filiptibell
Copy link
Collaborator

The next release of Lune will have the standard _VERSION global, in this format:
Lune x.y.z+luau
so the current version would be:
Lune 0.6.5+567
meaning you will be able to check using something like this:

if type(_VERSION) == "string" and string.sub(_VERSION, 1, 4) === "Lune" then
    -- Running in Lune
else
    -- Running in Roblox
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants