diff --git a/fetch.go b/fetch.go index 661db28..beee884 100644 --- a/fetch.go +++ b/fetch.go @@ -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) diff --git a/main.go b/main.go index 92191df..2ad21e3 100644 --- a/main.go +++ b/main.go @@ -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",