From 0f9cc73c8fa0eac5d2d5ca9a79db58244f1202ce Mon Sep 17 00:00:00 2001 From: Matthew John Date: Sat, 6 Jul 2024 09:34:16 +0100 Subject: [PATCH] fix: Remove duplicate .exe extension added to paths for windows inside symlink, as this is already handled by ConvertExecutableExt Issue #480 --- lib/symlink.go | 4 ++-- lib/symlink_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/symlink.go b/lib/symlink.go index 81933cfe..70a418e3 100644 --- a/lib/symlink.go +++ b/lib/symlink.go @@ -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 { diff --git a/lib/symlink_test.go b/lib/symlink_test.go index cf9d1123..8040a4dc 100644 --- a/lib/symlink_test.go +++ b/lib/symlink_test.go @@ -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.")