Skip to content

Commit ce15092

Browse files
committed
Adding multiple resource urls into lua require
1 parent 5c33146 commit ce15092

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

wiktionary_pron/scripts/lua_init.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,17 @@ await lua.doString(`
4444
end
4545
4646
47-
--local resp = fetch(string.format('https://cdn.statically.io/gh/hellpanderrr/hellpanderrr.github.io/master/wiktionary_pron/lua_modules/%s.%s',path,extension) ):await()
48-
--local resp = fetch(string.format('https://cdn.jsdelivr.net/gh/hellpanderrr/hellpanderrr.github.io@0.1.0/wiktionary_pron/lua_modules/%s.%s',path,extension) ):await()
4947
updateLoadingText(path, extension)
50-
--local resp = fetch(string.format('https://cdn.jsdelivr.net/gh/hellpanderrr/hellpanderrr.github.io@0.1.0/wiktionary_pron/lua_modules/%s.%s',path,extension) ):await()
48+
5149
local resp = fetch(string.format('https://cdn.statically.io/gh/hellpanderrr/hellpanderrr.github.io/master/wiktionary_pron/lua_modules/%s.%s',path,extension) ):await()
50+
if resp.status == 404 then
51+
resp = fetch(string.format('https://cdn.jsdelivr.net/gh/hellpanderrr/hellpanderrr.github.io@0.1.0/wiktionary_pron/lua_modules/%s.%s',path,extension) ):await()
52+
end
53+
if resp.status == 404 then
54+
resp = fetch(string.format('../wiktionary_pron/lua_modules/%s.%s',path,extension) ):await()
55+
end
5256
53-
--local resp = fetch(string.format('../wiktionary_pron/lua_modules/%s.%s',path,extension) ):await()
57+
--loca resp = fetch(string.format('../wiktionary_pron/lua_modules/%s.%s',path,extension) ):await()
5458
updateLoadingText("", "")
5559
local text = resp:text():await()
5660
local module = load(text)()

0 commit comments

Comments
 (0)