local C=require("\064\108\117\110\101\047\102\115")local W=require("\046\047\108\105\098\047\101\120\101\099")local M=require("\046\047\108\105\098\047\114\101\102\114\101\115\104\086\115\067\111\100\101\084\097\115\107\115")local d=require("\046\047\108\105\098\047\103\101\116\080\114\111\106\101\099\116\070\105\108\101")print("\084\114\117\115\116\105\110\103 \076\117\110\097\114 \115\099\114\105\112\116\115\046\046\046");(W({"\108\117\110\097\114";"--\116\114\117\115\116-\110\101\119";"\104\101\108\112"},{stdio="\100\101\102\097\117\108\116"})):assert()print("")print("\083\101\116\116\105\110\103 \117\112 \076\117\110\101 \101\100\105\116\111\114 \101\110\118\105\114\111\110\109\101\110\116\046\046\046");(W({"\108\117\110\101","\115\101\116\117\112"})):assert()print("")print("\085\112\100\097\116\105\110\103 \086\083 \067\111\100\101 \116\097\115\107\115 \102\105\108\101 \116\111 \105\110\099\108\117\100\101 \110\101\119 \076\117\110\097\114 \116\097\115\107\115\046\046\046")M()print("")if not(C.metadata("\080\097\099\107\097\103\101\115")).exists then print("\073\110\115\116\097\108\108\105\110\103 \109\105\115\115\105\110\103 \119\097\108\108\121 \112\097\099\107\097\103\101\115\046\046\046");(W({"\108\117\110\097\114","\119\097\108\108\121-\105\110\115\116\097\108\108"})):assert()end print("")local Z=d()if Z then print("\085\112\100\097\116\105\110\103 \115\111\117\114\099\101\109\097\112\046\106\115\111\110\046\046\046");(W({"\114\111\106\111";"\115\111\117\114\099\101\109\097\112","-\111","\115\111\117\114\099\101\109\097\112\046\106\115\111\110",Z})):assert()print("")end print("\080\114\111\106\101\099\116 \115\101\116\117\112 \100\111\110\101\033")
--[=[ lunar
	hide = true
]=]

local fs = require("@lune/fs")
local exec = require("./lib/exec")
local refreshVsCodeTasks = require("./lib/refreshVsCodeTasks")
local getProjectFile = require("./lib/getProjectFile")

print("Trusting Lunar scripts...")
exec({ "lunar", "--trust-new", "help" }, { stdio = "default" }):assert()
print("")

print("Setting up Lune editor environment...")
exec({ "lune", "setup" }):assert()
print("")

print("Updating VS Code tasks file to include new Lunar tasks...")
refreshVsCodeTasks()
print("")

if not fs.metadata("Packages").exists then
	print("Installing missing wally packages...")
	exec({ "lunar", "wally-install" }):assert()
end
print("")

local projectFile = getProjectFile()
if projectFile then
	print("Updating sourcemap.json...")
	exec({ "rojo", "sourcemap", "-o", "sourcemap.json", projectFile }):assert()
	print("")
end

print("Project setup done!")
