wip: attempting to remove '.exe' from binary name

This commit is contained in:
Travis McLane 2020-04-18 13:56:46 -05:00 committed by Lea Anthony
commit a2b066decb
2 changed files with 2 additions and 20 deletions

View file

@ -9,7 +9,6 @@ import (
"path/filepath"
"runtime"
"strconv"
"strings"
"time"
"github.com/leaanthony/mewn"
@ -137,7 +136,7 @@ func BuildDocker(binaryName string, buildMode string, projectOptions *ProjectOpt
"docker",
"run",
"--rm",
"-v", fmt.Sprintf("%s/build:/build", fs.Cwd()),
"-v", fmt.Sprintf("%s:/build", filepath.Join(fs.Cwd(), "build")),
"-v", fmt.Sprintf("%s:/source", fs.Cwd()),
"-e", fmt.Sprintf("LOCAL_USER_ID=%v", userid),
"-e", fmt.Sprintf("FLAG_LDFLAGS=%s", ldFlags(projectOptions, buildMode)),
@ -222,17 +221,6 @@ func BuildNative(binaryName string, forceRebuild bool, buildMode string, project
}
if binaryName != "" {
// Alter binary name based on OS
switch projectOptions.Platform {
case "windows":
if !strings.HasSuffix(binaryName, ".exe") {
binaryName += ".exe"
}
default:
if strings.HasSuffix(binaryName, ".exe") {
binaryName = strings.TrimSuffix(binaryName, ".exe")
}
}
buildCommand.Add("-o", filepath.Join("build", binaryName))
}

View file

@ -6,7 +6,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"runtime"
"sort"
"strings"
@ -188,7 +187,7 @@ func (po *ProjectOptions) GetNPMBinaryName() (PackageManager, error) {
if strings.Index(po.FrontEnd.Install, "yarn") > -1 {
return YARN, nil
}
helper
return UNKNOWN, nil
}
@ -336,11 +335,6 @@ func processBinaryName(po *ProjectOptions) {
if po.BinaryName == "" {
var binaryNameComputed = computeBinaryName(po.Name)
po.BinaryName = Prompt("The output binary name", binaryNameComputed)
if runtime.GOOS == "windows" {
if !strings.HasSuffix(po.BinaryName, ".exe") {
po.BinaryName += ".exe"
}
}
}
fmt.Println("Output binary Name: " + po.BinaryName)
}