Skip to content

Commit 527acd8

Browse files
authored
Feature: Add LuaXen's Packer macros
1 parent 598a421 commit 527acd8

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

MathParser.lua

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
--[[
22
Name: MathParser.lua
33
Author: ByteXenon [Luna Gilbert]
4-
Date: 2024-01-10
4+
Date: 2024-04-25
5+
----------------
6+
Do not edit this file, this file is just
7+
a wrapper for the MathParser API.
58
--]]
69

7-
-- Localize the path, so this file can be run from anywhere
8-
local scriptPath = (debug.getinfo(1).source:match("@?(.*/)") or "")
9-
local requirePath = scriptPath .. "./?.lua"
10-
local localPath = scriptPath .. "./"
11-
local oldPath = package.path
12-
package.path = package.path .. ";" .. requirePath
10+
local scriptPath, requirePath, localPath, oldPath
11+
if not LUAXEN_PACKER then
12+
-- Localize the path, so this file can be run from anywhere
13+
scriptPath = (debug.getinfo(1).source:match("@?(.*/)") or "")
14+
requirePath = scriptPath .. "./?.lua"
15+
localPath = scriptPath .. "./"
16+
oldPath = package.path
17+
package.path = package.path .. ";" .. requirePath
18+
end
1319

1420
local MathParser = require("src/MathParser")
1521

16-
-- Reset package.path
17-
package.path = oldPath
22+
if not LUAXEN_PACKER then
23+
-- Reset package.path
24+
package.path = oldPath
25+
end
1826

19-
return MathParser
27+
return MathParser

0 commit comments

Comments
 (0)