Skip to content

Commit

Permalink
Merge pull request #481 from warrensbox/480-file-extension-exe-on-win…
Browse files Browse the repository at this point in the history
…dows-doubled-in-version-120

fix: Remove duplicate .exe extension added to paths for windows inside symlink, as this is already handled by ConvertExecutableExt
  • Loading branch information
warrensbox authored Jul 6, 2024
2 parents 98eac38 + 0f9cc73 commit 4f00243
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/symlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ func CreateSymlink(cwd string, dir string) error {
}
defer r.Close()

w, err := os.Create(dir + ".exe")
w, err := os.Create(dir)
if err != nil {
return fmt.Errorf("Could not create target binary: %q.exe", dir)
return fmt.Errorf("Could not create target binary: %q", dir)
}
defer func() {
if c := w.Close(); err == nil {
Expand Down
2 changes: 1 addition & 1 deletion lib/symlink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestCreateSymlink(t *testing.T) {
CreateSymlink(symlinkPathDest, symlinkPathSrc)

if runtime.GOOS == "windows" {
_, err := os.Stat(symlinkPathSrc + ".exe")
_, err := os.Stat(symlinkPathSrc)
if err != nil {
t.Logf("Could not stat file copy at %v. [unexpected]", symlinkPathSrc)
t.Error("File copy was not created.")
Expand Down

0 comments on commit 4f00243

Please sign in to comment.