Skip to content

Commit

Permalink
refactor(lua): remove file check and move to subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Oct 30, 2021
1 parent 2c90290 commit 9de50f6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
File renamed without changes.
File renamed without changes.
16 changes: 1 addition & 15 deletions wrapper.lua → lua/wrapper.lua
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
local resource = GetCurrentResourceName()
local oxmysql = exports[resource]

local oxmysql = exports.oxmysql

CreateThread(function()
Wait(1000)
local url = GetResourceMetadata(resource, 'url', 0)
local version = GetResourceMetadata(resource, 'version', 0)
local link = ('%s/releases/download/v%s/oxmysql-v%s.zip'):format(url, version, version)

local path = GetResourcePath(resource):gsub('//', '/')
path = ('%s/oxmysql.js'):format(path)
local system = os.getenv('OS')
if system and system:match('Windows') then
path = path:gsub('/', '\\')
end
local file = io.open(path, 'r')

if file ~= nil then file:close() else
error(('Unable to locate built "oxmysql.js" - please download the release!\n ^3- %s^0\n'):format(link))
end

PerformHttpRequest(('%s/main/fxmanifest.lua'):format(url:gsub('github.com', 'raw.githubusercontent.com')), function(error, response)
if error == 200 then
local latest = response:match('%d%.%d+%.%d+')
Expand Down

0 comments on commit 9de50f6

Please sign in to comment.