Skip to content

Commit

Permalink
updated pull to use zls version string instead of zig and renamed fun…
Browse files Browse the repository at this point in the history
…ctions for sensible compute
  • Loading branch information
tristanisham committed Oct 25, 2024
1 parent 7b4ec20 commit 7209df1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions cli/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (z *ZVM) Install(version string, force bool) error {

log.Debug("tarPath", "url", tarPath)

tarResp, err := reqZigDownload(tarPath)
tarResp, err := requestDownload(tarPath)
if err != nil {
return err
}
Expand Down Expand Up @@ -197,8 +197,8 @@ func (z *ZVM) Install(version string, force bool) error {
return nil
}

// reqZigDownload HTTP requests Zig downloads from the official site and mirrors
func reqZigDownload(tarURL string) (*http.Response, error) {
// requestDownload HTTP requests Zig downloads from the official site and mirrors
func requestDownload(tarURL string) (*http.Response, error) {
log.Debug("requestWithMirror", "tarURL", tarURL)

tarResp, err := attemptDownload(tarURL)
Expand Down Expand Up @@ -395,7 +395,7 @@ func (z *ZVM) InstallZls(requestedVersion string, compatMode string, force bool)

log.Debug("tarPath", "url", tarPath)

tarResp, err := reqZigDownload(tarPath)
tarResp, err := requestDownload(tarPath)
if err != nil {
return err
}
Expand All @@ -418,14 +418,14 @@ func (z *ZVM) InstallZls(requestedVersion string, compatMode string, force bool)

var clr_opt_ver_str string
if z.Settings.UseColor {
clr_opt_ver_str = clr.Green(zigVersion)
clr_opt_ver_str = clr.Green(zlsVersion)
} else {
clr_opt_ver_str = zigVersion
clr_opt_ver_str = zlsVersion
}

pbar := progressbar.DefaultBytes(
int64(tarResp.ContentLength),
fmt.Sprintf("Downloading %s:", clr_opt_ver_str),
fmt.Sprintf("Downloading ZLS %s:", clr_opt_ver_str),
)

hash := sha256.New()
Expand Down
2 changes: 1 addition & 1 deletion cli/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (z *ZVM) setBin(ver string) error {
// CreateFile C:\Users\gs\.zvm\bin: The system cannot find the file specified.
//
// which leads to evaluation of the else case (line 59) and to an early return
// therefore the the inital symbolic link is never created.
// therefore the the initial symbolic link is never created.
if stat != nil {
if err == nil {
log.Debugf("Removing old %s", bin_dir)
Expand Down
6 changes: 3 additions & 3 deletions cli/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

func (z *ZVM) fetchVersionMap() (zigVersionMap, error) {
log.Debug("inital VMU", "url", z.Settings.VersionMapUrl)
log.Debug("initial VMU", "url", z.Settings.VersionMapUrl)

if err := z.loadSettings(); err != nil {
log.Warnf("could not load version map from settings: %q", err)
Expand Down Expand Up @@ -75,7 +75,7 @@ func (z *ZVM) fetchVersionMap() (zigVersionMap, error) {

// note: the zls release-worker uses the same index format as zig, but without the latest master entry.
func (z *ZVM) fetchZlsTaggedVersionMap() (zigVersionMap, error) {
log.Debug("inital ZRW", "url", z.Settings.ZlsReleaseWorkerBaseUrl)
log.Debug("initial ZRW","func", "fetchZlsTaggedVersionMap", "url", z.Settings.ZlsReleaseWorkerBaseUrl)

if err := z.loadSettings(); err != nil {
log.Warnf("could not load zls release worker base url from settings: %q", err)
Expand Down Expand Up @@ -131,7 +131,7 @@ func (z *ZVM) fetchZlsTaggedVersionMap() (zigVersionMap, error) {
// note: the zls release-worker uses the same index format as zig, but without the latest master entry.
// this function does not write the result to a file.
func (z *ZVM) fetchZlsVersionByZigVersion(version string, compatMode string) (zigVersion, error) {
log.Debug("inital ZRW", "url", z.Settings.ZlsReleaseWorkerBaseUrl)
log.Debug("initial ZRW","func", "fetchZlsVersionByZigVersion", "url", z.Settings.ZlsReleaseWorkerBaseUrl)

if err := z.loadSettings(); err != nil {
log.Warnf("could not load zls release worker base url from settings: %q", err)
Expand Down

0 comments on commit 7209df1

Please sign in to comment.