Skip to content

Commit

Permalink
final touches? in accordance with comments
Browse files Browse the repository at this point in the history
  • Loading branch information
iamtimmy committed Jan 28, 2024
1 parent 4e9865e commit 53e258d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions cli/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ func (z *ZVM) InstallZls(version string) error {

fmt.Println("Finding ZLS executable...")


// make sure dir exists
installDir := filepath.Join(z.zvmBaseDir, version)
err := os.MkdirAll(installDir, 0755)
Expand All @@ -302,7 +301,6 @@ func (z *ZVM) InstallZls(version string) error {

arch, osType := zigStyleSysInfo()
expectedArchOs := fmt.Sprintf("%v-%v", arch, osType)
expectedArchOs := fmt.Sprintf("%v-%v", arch, osType)

filename := "zls"
if osType == "windows" {
Expand All @@ -317,7 +315,6 @@ func (z *ZVM) InstallZls(version string) error {

downloadUrl, err := getZLSDownloadUrl(version, expectedArchOs)
if err != nil {
fmt.Println("what?")
return err
}

Expand All @@ -334,10 +331,6 @@ func (z *ZVM) InstallZls(version string) error {
}
defer response.Body.Close()

// if resp.ContentLength == 0 {
// return fmt.Errorf("invalid ZLS content length (%d bytes)", resp.ContentLength)
// }

pbar := progressbar.DefaultBytes(
int64(response.ContentLength),
"Downloading ZLS",
Expand All @@ -348,10 +341,10 @@ func (z *ZVM) InstallZls(version string) error {

if shouldUnzip == false {
file, err := os.Create(binaryLocation)

if err != nil {
return err
}
defer file.Close()

if _, err := io.Copy(io.MultiWriter(pbar, file), response.Body); err != nil {
return err
Expand Down

0 comments on commit 53e258d

Please # to comment.