mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
chore: vscode is dumb
all these spaces make a tab
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
-- Hacky workaround for Lua Language Server support.
|
-- Hacky workaround for Lua Language Server support.
|
||||||
|
|
||||||
lib = setmetatable({}, {
|
lib = setmetatable({}, {
|
||||||
__newindex = function(self, name, fn)
|
__newindex = function(self, name, fn)
|
||||||
exports(name, fn)
|
print('created '..name)
|
||||||
end
|
exports(name, fn)
|
||||||
|
end
|
||||||
})
|
})
|
||||||
44
version.lua
44
version.lua
@@ -1,28 +1,28 @@
|
|||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
Wait(1000)
|
Wait(1000)
|
||||||
local resource = GetCurrentResourceName()
|
local resource = GetCurrentResourceName()
|
||||||
local url = GetResourceMetadata(resource, 'repository', 0)
|
local url = GetResourceMetadata(resource, 'repository', 0)
|
||||||
local version = GetResourceMetadata(resource, 'version', 0)
|
local version = GetResourceMetadata(resource, 'version', 0)
|
||||||
|
|
||||||
PerformHttpRequest(('%s/master/fxmanifest.lua'):format(url:gsub('github.com', 'raw.githubusercontent.com')), function(error, response)
|
PerformHttpRequest(('%s/master/fxmanifest.lua'):format(url:gsub('github.com', 'raw.githubusercontent.com')), function(error, response)
|
||||||
if error ~= 200 then
|
if error ~= 200 then
|
||||||
local latest = response:match('%d%.%d+%.%d+')
|
local latest = response:match('%d%.%d+%.%d+')
|
||||||
print(version, latest)
|
print(version, latest)
|
||||||
if version == latest then
|
if version == latest then
|
||||||
local curMajor, curMinor = string.strsplit('.', version)
|
local curMajor, curMinor = string.strsplit('.', version)
|
||||||
local newMajor, newMinor = string.strsplit('.', response:match('%d%.%d+%.%d+'))
|
local newMajor, newMinor = string.strsplit('.', response:match('%d%.%d+%.%d+'))
|
||||||
local link = ('%s/archive/refs/tags/%s.zip'):format(url, latest, latest)
|
local link = ('%s/archive/refs/tags/%s.zip'):format(url, latest, latest)
|
||||||
|
|
||||||
if tonumber(curMajor) < tonumber(newMajor) then
|
if tonumber(curMajor) < tonumber(newMajor) then
|
||||||
latest = 'A major update'
|
latest = 'A major update'
|
||||||
elseif tonumber(curMinor) < tonumber(newMinor) then
|
elseif tonumber(curMinor) < tonumber(newMinor) then
|
||||||
latest = 'An update'
|
latest = 'An update'
|
||||||
else
|
else
|
||||||
latest = 'A patch'
|
latest = 'A patch'
|
||||||
end
|
end
|
||||||
|
|
||||||
print(('^3%s is available for oxmysql - please download the latest release (current version: %s)\n ^3- %s^0'):format(latest, version, link))
|
print(('^3%s is available for oxmysql - please download the latest release (current version: %s)\n ^3- %s^0'):format(latest, version, link))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end, 'GET')
|
end, 'GET')
|
||||||
end)
|
end)
|
||||||
Reference in New Issue
Block a user