Update basaltPackager.lua
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
-- This file is able to minify and create a single file out of a project folder
|
||||||
|
-- only works for basalt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- The minify part is fully made by stravant and can be found here: https://github.com/stravant/LuaMinify/blob/master/RobloxPlugin/Minify.lua
|
-- The minify part is fully made by stravant and can be found here: https://github.com/stravant/LuaMinify/blob/master/RobloxPlugin/Minify.lua
|
||||||
-- Thanks to him for his awesome work!
|
-- Thanks to him for his awesome work!
|
||||||
|
|
||||||
@@ -402,9 +408,13 @@ local minify = function(cd)local dd,__a=ParseLua(cd)if not dd then return false,
|
|||||||
return true,Format_Mini(__a)end
|
return true,Format_Mini(__a)end
|
||||||
|
|
||||||
-- Packaging part:
|
-- Packaging part:
|
||||||
local projectPath = "Basalt"
|
local args = table.pack(...)
|
||||||
|
local projectPath = args[1] or "Basalt"
|
||||||
|
local minifyProject = args[2]=="true" and true or false
|
||||||
local outputFileName = "basalt.lua"
|
local outputFileName = "basalt.lua"
|
||||||
|
|
||||||
|
assert(fs.isDir(projectPath), "Unable to find directory: "..projectPath)
|
||||||
|
|
||||||
local projectFiles = {
|
local projectFiles = {
|
||||||
"objects",
|
"objects",
|
||||||
"libraries",
|
"libraries",
|
||||||
@@ -417,7 +427,6 @@ local subDirs = {
|
|||||||
"objects", "libraries"
|
"objects", "libraries"
|
||||||
}
|
}
|
||||||
local mainFile = "main.lua"
|
local mainFile = "main.lua"
|
||||||
local minifyProject = true
|
|
||||||
|
|
||||||
local outputFile = io.open(outputFileName, "w")
|
local outputFile = io.open(outputFileName, "w")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user