Skip to content

Commit 058d106

Browse files
authored
Merge pull request #29 from mah0x211/change-the-official-lua-url
Change the official Lua URL from www.lua.org to lua.org
2 parents 1efd713 + b16d83d commit 058d106

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ $ lenv vers
8383
...snip...
8484
```
8585

86+
**Package URL's**
87+
88+
the following URL's are used to download the version files and source files.
89+
90+
- Lua: https://lua.org/ftp/
91+
- LuaJIT: https://github.com/LuaJIT/LuaJIT.git
92+
- LuaRocks: https://luarocks.github.io/luarocks/releases/
93+
8694

8795
## Usage
8896

fetch.go

+6
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ func CmdFetch() {
153153
}
154154
defer rsp.Body.Close()
155155

156+
// check status code
157+
if rsp.StatusCode != http.StatusOK {
158+
eprintf("failed to download %q: %s\n", target.cfg.ReleaseURL, rsp.Status)
159+
continue
160+
}
161+
156162
b, err := io.ReadAll(rsp.Body)
157163
if err != nil {
158164
eprintf("failed to read body: %v\n", err)

main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ var (
3131
Name: "lua",
3232
RootDir: filepath.Join(LenvDir, "lua"),
3333
VersionFile: filepath.Join(LenvDir, "lua_vers.txt"),
34-
ReleaseURL: "http://www.lua.org/ftp/",
35-
DownloadURL: "http://www.lua.org/ftp/",
34+
ReleaseURL: "http://lua.org/ftp/",
35+
DownloadURL: "http://lua.org/ftp/",
3636
}
3737
LuaJitCfg = &TargetConfig{
3838
Name: "luajit",

0 commit comments

Comments
 (0)