Skip to content

Commit 62df39d

Browse files
authored
Fix issue with upgrading on Windows (#646)
This changes ensures that the upgrade process does not try to replace the exercism binary with a non executable file. There is probably a more extensive check we can do to ensure we have the correct file. I did not choose to use the full name as Configlet is also using the cli pkg for upgrading its binary.
1 parent cfd008a commit 62df39d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cli/cli.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ func extractBinary(source *bytes.Reader, os string) (binary io.ReadCloser, err e
164164
}
165165

166166
for _, f := range zr.File {
167+
info := f.FileInfo()
168+
if info.IsDir() || !strings.HasSuffix(f.Name, ".exe") {
169+
continue
170+
}
167171
return f.Open()
168172
}
169173
} else {

0 commit comments

Comments
 (0)