Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanctech committed Jul 28, 2021
1 parent 642a295 commit a8ce6c7
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions sonorancad/core/plugin_loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ local function doRestart()
f:write("plugin")
f:close()
Wait(5000)
--ExecuteCommand("ensure sonoran_updatehelper")
ExecuteCommand("ensure sonoran_updatehelper")
end)
end

Expand Down Expand Up @@ -62,34 +62,14 @@ local function downloadPlugin(name, url)
local f = assert(io.open(savePath, 'wb'))
f:write(data)
f:close()
<<<<<<< Updated upstream
local unzipPath = GetResourcePath(GetCurrentResourceName()).."/plugins/"
debugLog("Unzipping to: "..unzipPath)
exports[GetCurrentResourceName()]:UnzipFolder(savePath, unzipPath)
-- move contents of actual plugin folder to proper place
exports[GetCurrentResourceName()]:UnzipFolder(savePath, unzipPath)
os.remove(savePath)
infoLog(("Plugin %s successfully downloaded."):format(name))
local result = exports[GetCurrentResourceName()]:DeleteDirectoryRecursively(movePath)
if not result then
errorLog("Failed to delete plugin stream folder before moving updated version.")
=======
local unzipPath = GetResourcePath(GetCurrentResourceName()).."/plugins/"..name.."/"
debugLog(("Unzipping %s to %s"):format(savePath, unzipPath))
exports[GetCurrentResourceName()]:UnzipFolder(savePath, name, unzipPath)
os.remove(savePath)
infoLog(("Plugin %s successfully downloaded."):format(name))
local streamPath = unzipPath.."/stream/"
infoLog(("Checking %s plugin update for stream folder"):format(name))
if exists(streamPath) then
debugLog(("Found stream folder in %s, checking if it is nested properly."):format(name))
if exists(streamPath..name.."/") then
debugLog(("Plugin %s is nested properly. Moving to sonorancad resource folder."):format(name))
os.rename(streamPath..name.."/", GetResourcePath(GetCurrentResourceName()).."/stream/"..name.."/")
infoLog(("%s plugin's updated stream folder moved to sonorancad resource folder. $s plugin update completed successfully!"):format(name,name))
else
warnLog(("plugin %s has a stream folder but is not nested properly (plugins/%s/stream/%s/{streamed assets}). Please Contact Sonoran Support."):format(name,name,name))
end
>>>>>>> Stashed changes
end
PluginsWereUpdated = true
else
Expand Down

0 comments on commit a8ce6c7

Please sign in to comment.