Compare commits
5 Commits
main
...
b0f8c1267a
| Author | SHA1 | Date | |
|---|---|---|---|
|
b0f8c1267a
|
|||
|
e079d75fab
|
|||
|
17e3a3b5a8
|
|||
|
d575f3c98c
|
|||
|
f8ef3b0210
|
19
install.lua
19
install.lua
@@ -2,8 +2,7 @@ local repoRoot = "https://git.colon-three.com/kodi/snowier/raw/branch/main/"
|
|||||||
|
|
||||||
local URLs = {
|
local URLs = {
|
||||||
fileIndex = repoRoot .. "index.json",
|
fileIndex = repoRoot .. "index.json",
|
||||||
-- Implementation of sha256 pulled from here
|
sha256 = repoRoot .. "sha256.lua"
|
||||||
sha2 = "https://raw.githubusercontent.com/Egor-Skriptunoff/pure_lua_SHA/refs/heads/master/sha2.lua"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local log = {}
|
local log = {}
|
||||||
@@ -13,6 +12,11 @@ function log.info(value)
|
|||||||
print("[I] " .. value)
|
print("[I] " .. value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- @param value string
|
||||||
|
function log.debug(value)
|
||||||
|
print("[D] " .. value)
|
||||||
|
end
|
||||||
|
|
||||||
--- @param value string
|
--- @param value string
|
||||||
function log.error(value)
|
function log.error(value)
|
||||||
printError("[E] " .. value)
|
printError("[E] " .. value)
|
||||||
@@ -21,15 +25,16 @@ end
|
|||||||
local function main()
|
local function main()
|
||||||
log.info("Starting installer")
|
log.info("Starting installer")
|
||||||
|
|
||||||
if not fs.exists("sha2.lua") then
|
if not fs.exists("sha256.lua") then
|
||||||
log.info("Downloading sha2.lua")
|
log.info("Downloading sha256.lua")
|
||||||
local sharequest = http.get(URLs.sha2)
|
local sharequest = http.get(URLs.sha256)
|
||||||
local shafile = fs.open("sha2.lua", "w")
|
local shafile = fs.open("sha256.lua", "w")
|
||||||
shafile.write(sharequest.readAll())
|
shafile.write(sharequest.readAll())
|
||||||
shafile.close()
|
shafile.close()
|
||||||
sharequest.close()
|
sharequest.close()
|
||||||
end
|
end
|
||||||
local hash = require("sha2")
|
log.debug(package.path)
|
||||||
|
local hash = require("sha256")
|
||||||
|
|
||||||
log.info("Downloading index file")
|
log.info("Downloading index file")
|
||||||
local indexrequest = http.get(URLs.fileIndex)
|
local indexrequest = http.get(URLs.fileIndex)
|
||||||
|
|||||||
5691
sha256.lua
Normal file
5691
sha256.lua
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user