Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Name - GSProjectBuilder
- // Author - LINKI
- // Version - 0.5
- help = "<color=blue><b>GSProjectBuilder</b></color>\n<color=green> Author</color><color=grey> - </color><color=yellow>LINKI</color>\n<color=green> Version<color=grey> - </color>0.5</color>\n<color=blue><b>Supported commands:</b></color>\n<color=yellow> help - <i>print this text</i></color>\n<color=yellow> init [Path/ProjectName] - <i>create project folder/files</i></color>\n<color=yellow> remove [ProjectPath] - <i>remove project</i></color>\n<color=yellow> remove-all [ProjectsPath] - <i>remove all projects in projects folder</i></color>\n<color=yellow> list [ProjectsFolder] - <i>print all projects in folder</i></color>\n<color=yellow> compile [ProjectPath] (opt: MainSourceName) - <i>just compile project</i></color>\n<color=yellow> run [ProjectPath] (opt: params) (opt: MainSourceName) - <i>compile and run project</i></color>\n<color=yellow> run-debug [ProjectPath] (opt:params) (opt: MainSourceName) - <i>compile project and run debug mode</i></color>\n<color=yellow> debug [BinaryExec/ProjectPath] - <i>Run project/BinaryExec in debug mode</i></color>"
- if params.len < 1 then exit(help)
- shell = get_shell()
- pc = shell.host_computer()
- error = function(msg, quit = true)
- if quit then ex = @exit else ex = @print
- ex("<color=red><b>" + msg + "</b></color>")
- end function
- info = function(msg, prefix = "(i)")
- print("<color=yellow><i>" + prefix + msg + "</i></color>")
- end function
- errorInfo = function(msg, infomsg)
- error(msg, false)
- info(infomsg)
- exit
- end function
- general = function(msg)
- print("<color=blue>" + msg + "</color>")
- end function
- whoiam = function()
- user = active_user
- //root check
- if user == "root" then
- root = true
- else
- result = pc.create_user("whoiam", "-")
- if result == true then
- root = true
- pc.delete_user("whoiam", true)
- else
- root = false
- end if
- end if
- if root then root = "true" else root = "false"
- return [user, root]
- end function
- runExec = function(exec, runParams = null, debug = false)
- person = whoiam()
- if debug then injectDebug()
- info("Runned from " + person[0] + ", root = " + person[1])
- info("Run exec - " + exec)
- stime = time()
- info("StartTime: " + stime)
- //shell.launch(exec, runParams)
- if debug then
- if runParams then
- shell.debug_launch(exec, runParams)
- else
- shell.debug_launch(exec)
- end if
- else
- if runParams then
- shell.launch(exec, runParams)
- else
- shell.launch(exec)
- end if
- end if
- etime = time()
- info("EndTime: " + etime)
- info("ElapsedTime: " + (etime - stime))
- end function
- injectDebug = function()
- print("<color=yellow><b>[DebugMode]</b></color>")
- shell = get_shell
- pc = shell.host_computer
- router = get_router
- file = pc.File("/")
- crypto = include_lib("/lib/crypto.so")
- debugInject = function(sType)
- inject = { }
- for f in sType.values[0]
- inject["debug_" + f.key] = @f.value
- end for
- for f in inject
- sType.values[0][f.key] = @f.value
- end for
- sType.values[0]["info"] = @info
- end function
- debugInject(shell)
- debugInject(pc)
- debugInject(router)
- debugInject(file)
- if crypto then debugInject(crypto)
- shell.values[0].connect_service = function(self, ipAddress, port, user, password, serviceId)
- s = ipAddress + ":" + port + ", " + user + ":" + password + ", id="
- result = self.debug_connect_service(ipAddress, port, user, password, serviceId)
- if not serviceId then serviceId = "NotSet"
- s = s + serviceId
- if result then
- self.info("Connected[" + typeof(result) + "] to - " + s)
- else
- self.info("Bad attempt connect to - " + s)
- end if
- return result
- end function
- shell.values[0].start_terminal = function(self)
- self.info("Terminal started")
- return self.debug_start_terminal(self)
- end function
- shell.values[0].scp_upload = function(self, path_orig, path_dest, remote_shell)
- self.info("Send file '" + path_orig + "' to '" + path_dest + "'[reciever]")
- return self.debug_scp_upload(path_orig, path_dest, remote_shell)
- end function
- shell.values[0].build = function(self, pathSource, pathBinary)
- result = self.debug_build(pathSource, pathBinary)
- if result then
- self.info("Compile error in '" + pathSource + "' : " + result)
- else
- self.info("Compiled '" + pathSource + "' to '" + pathBinary + "'")
- end if
- return result
- end function
- shell.values[0].launch = function(self, path, params)
- self.info("Launch '" + path + "' with params=""" + params + """")
- if params then
- return self.debug_launch(path, params)
- else
- return self.debug_launch(path)
- end if
- end function
- shell.values[0].host_computer = function(self)
- pc = self.debug_host_computer()
- self.info("Received Сomputer object, lanIP = " + pc.debug_lan_ip)
- return pc
- end function
- pc.values[0].get_ports = function(self)
- result = self.debug_get_ports()
- list = []
- for item in result
- s = item.port_number
- if item.is_closed then s = s + "(closed)"
- list.push(s)
- end for
- self.info("Received ports = " + list)
- return result
- end function
- pc.values[0].File = function(self, path)
- file = self.debug_File(path)
- if file then
- self.info("Received file - '" + path + "'")
- else
- self.info("Bad attempt to get file - '" + path + "'")
- end if
- return file
- end function
- pc.values[0].create_folder = function(self, path, nameFolder)
- result = self.debug_create_folder(path, nameFolder)
- if result then
- self.info("Created folder - '" + path + "/" + name + "'")
- else
- self.info("Bad attempt create folder - '" + path + "/" + name + "'")
- end if
- return result
- end function
- pc.values[0].current_path = function(self)
- result = self.debug_current_path()
- self.info("Received current path - '" + result + "'")
- return result
- end function
- pc.values[0].is_network_active = function(self)
- result = self.debug_is_network_active()
- if result then s = "true" else "false"
- self.info("Received network state = " + s)
- return result
- end function
- pc.values[0].lan_ip = function(self)
- result = self.debug_lan_ip()
- self.info("Received lanIP = " + result)
- return result
- end function
- pc.values[0].touch = function(self, path, nameFile)
- result = self.debug_touch(path, nameFile)
- if result == true then
- self.info("Created file - '" + path + "/" + nameFile + "'")
- else
- self.info("Bad attempt create file - '" + path + "/" + nameFile + "', msg = " + result)
- end if
- return result
- end function
- pc.values[0].show_procs = function(self)
- result = self.debug_show_procs()
- self.info("Received procs")
- return result
- end function
- pc.values[0].network_devices = function(self)
- result = self.debug_network_devices()
- self.info("Received netDevices")
- return result
- end function
- pc.values[0].change_password = function(self, user, password)//Root
- result = self.debug_change_password(user, password)
- if result == true then
- self.info("Changed password - " + user + ":" + password)
- else
- self.info("Bad attempt change password - " + user + ":" + password + ", msg = " + result)
- end if
- return result
- end function
- pc.values[0].create_user = function(self, user, password)//Root
- result = self.debug_create_user(user, password)
- if result == true then
- self.info("Created user - " + user + ":" + password)
- else
- self.info("Bad attempt create user - " + user + ":" + password + ", msg = " + result)
- end if
- return result
- end function
- pc.values[0].delete_user = function(self, user, removeHome)//Root
- result = self.debug_delete_user(user, removeHome)
- if result == true then
- s = ""
- if removeHome then s = ", removed home folder"
- self.info("Deleted user - " + user + s)
- else
- self.info("Bad attempt delete user - " + user + ", msg = " + result)
- end if
- return result
- end function
- pc.values[0].create_group = function(self, username, groupname)//Root
- result = self.debug_create_group(user, groupname)
- if result == true then
- self.info("Added user - '" + username + "' to group - '" + groupname + "'")
- else
- self.info("Bad attempt add user '" + user + "' to group - '" + groupname + "', msg = " + result)
- end if
- return result
- end function
- pc.values[0].delete_group = function(self, username, groupname)//Root
- result = self.debug_delete_group(user, groupname)
- if result == true then
- self.info("Deleted user - '" + username + "' from group - '" + groupname + "'")
- else
- self.info("Bad attempt delete user '" + user + "' from group - '" + groupname + "', msg = " + result)
- end if
- return result
- end function
- pc.values[0].groups = function(self, username)
- result = self.debug_groups(username)
- self.info("Received user - '" + username + "' groups")
- return result
- end function
- router.values[0].public_ip = function(self)
- result = self.debug_public_ip()
- self.info("Received publicIP = " + result)
- return result
- end function
- router.values[0].local_ip = function(self)
- result = self.debug_local_ip()
- self.info("Received localIP = " + result)
- return result
- end function
- router.values[0].ping_port = function(self, port)
- result = self.debug_ping_port(port)
- if result then
- self.info("Ping port " + port + ", result = OK")
- else
- self.info("Ping port " + port + ", result = BAD")
- end if
- return result
- end function
- router.values[0].port_info = function(self, port)
- result = self.debug_port_self.info(port)
- self.info("Received port info, port - " + port.port_number)
- return result
- end function
- router.values[0].used_ports = function(self)
- result = self.debug_used_ports()
- list = []
- for item in result
- s = item.port_number
- if item.is_closed then s = s + "(closed)"
- list.push(s)
- end for
- self.info("Received used ports = " + list)
- return result
- end function
- router.values[0].computer_ports = function(self, address)
- result = self.debug_computer_ports(address)
- if result then
- list = []
- for item in result
- s = item.port_number
- if item.is_closed then s = s + "(closed)"
- list.push(s)
- end for
- self.info("Received ports on computer - '" + address + "', ports = " + list)
- else
- self.info("Bad attempt receive ports on computer - " + address)
- end if
- return result
- end function
- router.values[0].computers_lan_ip = function(self)
- result = self.debug_computers_lan_ip()
- self.info("Received computers lanIPs, result = " + result)
- return result
- end function
- router.values[0].essid_name = function(self)
- result = self.debug_essid_name()
- self.info("Received essid name = " + result)
- return result
- end function
- router.values[0].bssid_name = function(self)
- result = self.debug_bssid_name()
- self.info("Received bssid name = " + result)
- return result
- end function
- file.values[0].copy = function(self, path, newName)
- result = self.debug_copy(path, newName)
- if result == true then
- self.info("File - '" + self.debug_path + "' copyed to '" + path + "/" + newName + "'")
- else
- self.info("Bad attempt copy file - '" + self.debug_path + "' to '" + path + "/" + newName + "'")
- end if
- return result
- end function
- file.values[0].move = function(self, path, newName)
- old = self.debug_path
- result = self.debug_move(path, newName)
- if result == true then
- self.info("File - '" + old + "' moved to '" + path + "/" + newName + "'")
- else
- self.info("Bad attempt move file - '" + old + "' to '" + path + "/" + newName + "', msg = " + result)
- end if
- return result
- end function
- file.values[0].rename = function(self, newName)
- old = self.debug_name
- self.debug_rename(newName)
- self.info("File renamed from - '" + old + "' to '" + newName + "'")
- return result
- end function
- file.values[0].path = function(self)
- result = self.debug_name()
- self.info("Received path - '" + result + "' from file/folder")
- return result
- end function
- file.values[0].parent = function(self)
- result = self.debug_name()
- self.info("Received parent folder - '" + result.debug_path + "' from file/folder - '" + self.debug_path + "'")
- return result
- end function
- file.values[0].name = function(self)
- result = self.debug_name()
- self.info("Received name - '" + result + "' from file/folder - '" + self.debug_path + "'")
- return result
- end function
- file.values[0].is_folder = function(self)
- result = self.debug_is_folder()
- if result then s = "true" else s = "false"
- self.info("Received 'is_folder' from file/folder - '" + self.debug_path + "', result = " + s)
- return result
- end function
- file.values[0].content = function(self)
- result = self.debug_content()
- if result then
- self.info("Received content from file - '" + self.debug_path + "'")
- else
- self.info("Bad attempt receive content from file - '" + self.debug_path + "'")
- end if
- return result
- end function
- file.values[0].set_content = function(self, content)
- result = self.debug_set_content(content)
- if result == true then
- self.info("Set content in file - '" + self.debug_path + "'")
- else
- self.info("Bad attempt set content in file - '" + self.debug_path + "', msg = " + result)
- end if
- return result
- end function
- file.values[0].is_binary = function(self)
- result = self.debug_is_binary()
- if result then s = "true" else s = "false"
- self.info("Received 'is_binary' from file/folder - '" + self.debug_path + "', result = " + s)
- return result
- end function
- file.values[0].has_permission = function(self, typePerm)
- result = self.debug_has_permission(typePerm)
- if result then s = "true" else s = "false"
- self.info("Received 'has_permission' - '" + typePerm + "' from file/folder - '" + self.debug_path + "', result = " + s)
- return result
- end function
- file.values[0].delete = function(self)
- result = self.debug_delete()
- if result then
- self.info("File/Folder - '" + self.debug_path + "' deleted")
- else
- self.info("Bad attempt delete file/folder - '" + self.debug_path + "', msg = " + result)
- end if
- return result
- end function
- file.values[0].get_folders = function(self)
- result = self.debug_get_folders()
- if result then
- self.info("Received folders(" + result.len + ") from folder - '" + self.debug_path + "'")
- else
- self.info("Bad attempt receive folders from file - '" + self.debug_path + "' :)")
- end if
- return result
- end function
- file.values[0].get_files = function(self)
- result = self.debug_get_files()
- if result then
- self.info("Received files(" + result.len + ") from folder - '" + self.debug_path + "'")
- else
- self.info("Bad attempt receive files from file - '" + self.debug_path + "' :)")
- end if
- return result
- end function
- file.values[0].chmod = function(self, typePerm, isRecursive)
- result = self.debug_chmod(typePerm, isRecursive)
- self.info("Chmoded file/folder - '" + self.debug_path + "', with permissions - '" + typePerm + "'")
- return result
- end function
- file.values[0].permissions = function(self)
- result = self.debug_permissions()
- self.info("Received file/folder permissions - '" + result + "' from '" + self.debug_path + "'")
- return result
- end function
- file.values[0].owner = function(self)
- result = self.debug_owner()
- self.info("Received file/folder owner - '" + result + "' from '" + self.debug_path + "'")
- return result
- end function
- file.values[0].set_owner = function(self, owner, isRecursive)
- result = self.debug_set_owner(owner, isRecursive)
- self.info("Set owner - '" + owner + "' on file - '" + self.debug_path + "'")
- return result
- end function
- file.values[0].group = function(self)
- result = self.debug_group()
- self.info("Received file/folder group - '" + result + "' from '" + self.debug_path + "'")
- return result
- end function
- file.values[0].set_group = function(self, groupname, isRecursive)
- result = self.debug_set_group(groupname, isRecursive)
- self.info("Set group - '" + groupname + "' on file/folder - '" + self.debug_path + "'")
- return result
- end function
- file.values[0].size = function(self)
- result = self.debug_size(self)
- self.info("Received size file/folder - '" + self.debug_path + "' = " + result)
- return result
- end function
- crypto.values[0].decipher = function(self, user, encryptPass)
- self.info("Loaded decipher with data = " + user + ":" + encryptPass)
- result = self.debug_decipher(user, encryptPass)
- self.info("Result decipher - " + encryptPass + "==" + result)
- return result
- end function
- crypto.values[0].aircrack = function(self, pathFile)
- self.info("Loaded aircrack with file - '" + pathFile + "'")
- result = self.debug_aircrack(pathFile)
- self.info("Result aircrack = " + result)
- return result
- end function
- crypto.values[0].airmon = function(self, option, device)
- result = self.debug_airmon(option, device)
- self.info("Set airmon config - """ + option + " " + device + """")
- return result
- end function
- info("Functions injected")
- end function
- comand = params[0]
- if comand == "init" and params.len > 1 then
- path = params[1]
- if path.indexOf("/") == null then error("Bad path - '" + path + "'")
- name = path.split("/")[-1]
- folderPath = parent_path(path)
- folder = pc.File(folderPath)
- if not folder or not folder.is_folder or not folder.has_permission("w") then
- folder = pc.File(pc.current_path + "/" + folderPath)
- if not folder or not folder.is_folder or not folder.has_permission("w") then errorInfo("Could not open folder - '<i>" + folderPath + "</i>'","Check path and permision(w) folder")
- end if
- pc.create_folder(folder.path, name)
- projectPath = folder.path + "/" + name
- projectFolder = pc.File(projectPath)
- if not projectFolder or not projectFolder.is_folder or not projectFolder.has_permission("w") then errorInfo("Could not create/open folder - '<i>" + projectPath + "</i>'","Check path and permision(w) folder")
- pc.create_folder(projectPath, "build")
- pc.touch(projectPath, "Main.src")
- info("Created project - '" + projectPath + "'")
- exit
- else if comand == "remove" and params.len > 1 then
- path = params[1]
- folder = pc.File(path)
- if not folder or not folder.is_folder or not folder.has_permission("w") then
- folder = pc.File(pc.current_path + "/" + path)
- if not folder or not folder.is_folder or not folder.has_permission("w") then errorInfo("Could not open folder - '<i>" + path + "</i>'", "Check path and permision(w) folder")
- end if
- path = folder.path
- folder.delete()
- info("Removed project - '" + path + "'")
- exit
- else if comand == "remove-all" and params.len > 1 then
- path = params[1]
- folder = pc.File(path)
- if not folder or not folder.is_folder or not folder.has_permission("w") then
- folder = pc.File(pc.current_path + "/" + path)
- if not folder or not folder.is_folder or not folder.has_permission("w") then errorInfo("Could not open folder - '<i>" + path + "</i>'", "Check path and permision(w) folder")
- end if
- path = folder.path
- i = 0
- for f in folder.get_folders()
- if not f.has_permission("w") then
- info("Could not delete project - '" + f.path + "'")
- else
- f.delete()
- info("Removed project - '" + f.path + "'")
- i = i + 1
- end if
- end for
- info("Removed " + i + " projects in folder - '" + folder.path + "'")
- exit
- else if comand == "list" and params.len > 1 then
- path = params[1]
- folder = pc.File(path)
- if not folder or not folder.is_folder or not folder.has_permission("w") then
- folder = pc.File(pc.current_path + "/" + path)
- if not folder or not folder.is_folder or not folder.has_permission("w") then errorInfo("Could not open folder - '<i>" + path + "</i>'", "Check path and permision(w) folder")
- end if
- path = folder.path
- s = "NAME SIZE FILES OWNER"
- for f in folder.get_folders
- s = s + "\n" + f.name + " " + f.size + " " + f.get_files.len + " " + f.owner
- end for
- exit(format_columns(s))
- else if comand == "compile" and params.len > 1 then
- run = false
- debug = false
- if params.len > 2 then mainName = params[2] else mainName = "Main"
- else if comand == "run" or comand == "run-debug" and params.len > 1 then
- run = true
- if comand == "run-debug" then debug = true else debug = false
- if params.len > 2 then mainName = params[2] else mainName = "Main"
- if params.len > 3 then runParams = params[3:].join(" ") else runParams = null
- else if comand == "debug" and params.len > 1 then
- path = params[1]
- if params.len > 2 then runParams = params[2:].join(" ") else runParams = null
- folder = pc.File(path)
- if not folder or not folder.is_folder or not folder.has_permission("x") then
- folder = pc.File(pc.current_path + "/" + path)
- if not folder or not folder.is_folder or not folder.has_permission("x") then
- file = pc.File(path)
- if not file or not file.is_binary or not file.has_permission("x") then
- file = pc.File(pc.current_path + "/" + path)
- if not file or not file.is_binary or not file.has_permission("x") then errorInfo("Could not open file/folder - '<i>" + path + "</i>'", "Check path and permission(x) file/folder")
- end if
- end if
- end if
- if folder then
- if folder.is_folder then
- execPath = folder.path + "/build/" + folder.name
- file = pc.File(execPath)
- if not file or not file.is_binary or not file.has_permission("x") then errorInfo("Could not open file - '<i>" + execPath + "</i>'", "Check path and permission(x) file")
- else
- file = folder
- end if
- end if
- runExec(file.path, runParams, true)
- exit
- else
- exit(help)
- end if
- //LoadLibFolder
- libsFolderPath = "/lib"
- libsFolder = pc.File(libsFolderPath)
- if not libsFolder or not libsFolder.is_folder or not libsFolder.has_permission("r") then errorInfo("Libs folder not found", "Check permision(r) and folder path - '" + libsFolderPath + "'")
- //LoadProjectFolder
- projectFolderPath = params[1]
- projectFolder = pc.File(projectFolderPath)
- if not projectFolder or not projectFolder.is_folder or not projectFolder.has_permission("r") or not projectFolder.has_permission("w") then exit("Could not open ProjectFolder", "Check permissions(rw) and folder path - '" + projectFolderPath + "'")
- projectFolderPath = projectFolder.path
- projectName = projectFolder.name
- //LoadMainFile
- mainFile = pc.File(projectFolderPath + "/" + mainName)
- if not mainFile or mainFile.is_folder or mainFile.is_binary then
- mainFile = pc.File(projectFolderPath + "/" + mainName + ".src")
- if not mainFile or mainFile.is_folder or mainFile.is_binary or not mainFile.has_permission("r") then errorInfo("Main file not found", "Check permission(r) and path - '" + mainFilePath + "'")
- end if
- mainFile = { "File" : mainFile }
- //UtilFunctions
- validFile = function(file)
- return file and (file.is_folder or not file.is_binary) and file.has_permission("r")
- end function
- loadFile = function(name)
- if name and name[-1] == "*" then
- name = name[0:-2]
- if not name then name = "/"
- else if name == "*" then
- return projectFolder
- end if
- file = pc.File(projectFolderPath + "/" + name)
- if not validFile(file) then
- file = pc.File(projectFolderPath + "/" + name + ".src")
- if not validFile(file) then
- file = pc.File(libsFolderPath + "/" + name)
- if not validFile(file) then
- file = pc.File(libsFolderPath + "/" + name + ".src")
- if not validFile(file) then
- file = pc.File(name)
- if not validFile(file) then
- file = pc.File(name + ".src")
- if not validFile(file) then errorInfo("File/Folder - '<i>" + name + "</i>' not found!", "Check permission(read) and file/folder path")
- end if
- end if
- end if
- end if
- end if
- return { "File" : file }
- end function
- loadFilesInFolder = function(folder)
- files = []
- for file in folder.get_files
- if validFile(file) then
- if file.is_folder then
- files = files + loadFilesInFolder(file)
- else
- files.push({ "File" : file })
- end if
- end if
- end for
- return files
- end function
- loadDepends = function(fileWrap)
- importFiles = []; code = fileWrap.File.content.trim()
- index = code.indexOf(char(10))
- if index != null then
- fline = code[:index].trim()
- if fline[0] == "#" then
- fileWrap.Content = code[index:].trim()
- splited = fline.split(" ")
- if splited and splited.len > 1 then
- name = splited[0]
- args = splited[1:]
- if name == "#import" then
- for arg in args
- file = loadFile(arg)
- if file.File.is_folder then
- importFiles = importFiles + loadFilesInFolder(file.File)
- else
- importFiles.push(file)
- end if
- end for
- end if
- end if
- end if
- end if
- if not fileWrap.hasIndex("Content") then fileWrap.Content = code
- fileWrap.Content = fileWrap.Content.replace("\n", """+char(10)+""").replace("\t", """+char(9)+""")
- fileWrap.Depends = importFiles
- end function
- build = []
- setLevels = function(mainFile, level = 0)
- if not mainFile.hasIndex("Level") or mainFile.Level < level then mainFile.Level = level
- if not mainFile.hasIndex("Depends") then
- build.push(mainFile)
- loadDepends(mainFile)
- end if
- for file in mainFile.Depends
- if mainFile.File.path == file.File.path then error("Self recursion found in file - '<i>" + mainFile.File.path + "</i>'")
- if file.hasIndex("Depends") then
- for fd in file.Depends
- if mainFile.File.path == fd.File.path then error("Recursion found in files: '<i>" + mainFile.File.path + "</i>' and '<i>" + fd.File.path + "</i>'")
- end for
- end if
- if not file.hasIndex("Level") or file.Level < level + 1 then setLevels(file, level + 1)
- end for
- end function
- //SetLevels&LoadDepends
- setLevels(mainFile)
- //SortBuild
- build.sort("Level")
- build.reverse()
- //ImportFiles
- info("Imports:")
- content = ""; i = 0
- while i < build.len
- info("Imported - '" + build[i].File.path + "'", "")
- content = content + build[i].Content + "\n"
- i = i + 1
- end while
- content = content[0:-2]
- info("Imported " + build.len + " files")
- //Create/Get BuildFolder
- buildPath = projectFolder.path + "/build"
- if not pc.File(buildPath) then pc.create_folder(projectFolder.path, "build")
- //CreateOutFile
- outFileName = projectFolder.name + ".src"
- outFilePath = buildPath + "/" + outFileName
- outFile = pc.File(outFilePath)
- if not outFile or outFile.is_folder or outFile.is_binary then
- pc.touch(buildPath, outFileName)
- outFile = pc.File(outFilePath)
- end if
- if not outFile or outFile.is_folder then error("Could not create file - '<i>" + outFilePath + "</i>'")
- outFile.set_content(content)
- //Compile
- msg = shell.build(outFile.path, buildPath)
- if msg then error("Compile error : " + msg)
- info("Project compiled to '" + buildPath + "'")
- //Run
- if run then
- print
- runExec(buildPath + "/" + projectFolder.name, runParams, debug)
- end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement