Skip to content

Commit

Permalink
Merge pull request #29 from mah0x211/change-the-official-lua-url
Browse files Browse the repository at this point in the history
Change the official Lua URL from www.lua.org to lua.org
  • Loading branch information
mah0x211 authored Dec 21, 2023
2 parents 1efd713 + b16d83d commit 058d106
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ $ lenv vers
...snip...
```

**Package URL's**
the following URL's are used to download the version files and source files.

- Lua: https://lua.org/ftp/
- LuaJIT: https://github.com/LuaJIT/LuaJIT.git
- LuaRocks: https://luarocks.github.io/luarocks/releases/


## Usage

Expand Down
6 changes: 6 additions & 0 deletions fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ func CmdFetch() {
}
defer rsp.Body.Close()

// check status code
if rsp.StatusCode != http.StatusOK {
eprintf("failed to download %q: %s\n", target.cfg.ReleaseURL, rsp.Status)
continue
}

b, err := io.ReadAll(rsp.Body)
if err != nil {
eprintf("failed to read body: %v\n", err)
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ var (
Name: "lua",
RootDir: filepath.Join(LenvDir, "lua"),
VersionFile: filepath.Join(LenvDir, "lua_vers.txt"),
ReleaseURL: "http://www.lua.org/ftp/",
DownloadURL: "http://www.lua.org/ftp/",
ReleaseURL: "http://lua.org/ftp/",
DownloadURL: "http://lua.org/ftp/",
}
LuaJitCfg = &TargetConfig{
Name: "luajit",
Expand Down

0 comments on commit 058d106

Please sign in to comment.