From 21fdb3be7dcd269ba53b5bccefaba9f1984778bd Mon Sep 17 00:00:00 2001 From: bh90210 Date: Mon, 29 Jul 2019 19:12:05 +0300 Subject: [PATCH 01/11] fix(linux): fedora & centos support --- README.md | 11 ++++++----- cmd/linux.go | 4 +--- cmd/prerequisites.go | 32 ++++++++++++++++++++++++++++---- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2997391c..cb8b94d5 100644 --- a/README.md +++ b/README.md @@ -48,17 +48,19 @@ Make sure you have the xcode command line tools installed. This can be done by r #### Ubuntu 18.04, Debian 9, Zorin 15 -`sudo apt install pkg-config build-essential libgtk-3-dev libwebkit2gtk-4.0-dev` +`sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev` #### Arch Linux `sudo pacman -S webkit2gtk gtk3` -#### Red Hat Based Distros +#### Fedora 30 -`sudo yum install webkit2gtk-devel gtk3-devel` +`sudo yum install webkit2gtk3-devel gtk3-devel` -Note: If you have successfully installed these dependencies on a different flavour of Linux, please consider submitting a PR. +#### Centos 7 + +`sudo yum install webkitgtk3-devel gtk3-devel` ### Windows @@ -121,4 +123,3 @@ This project was mainly coded to the following albums: * [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB) * [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF) * [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v) - diff --git a/cmd/linux.go b/cmd/linux.go index 9a1e55ae..0b8a393f 100644 --- a/cmd/linux.go +++ b/cmd/linux.go @@ -79,10 +79,8 @@ func GetLinuxDistroInfo() *DistroInfo { } // Check distro name against list of distros result.Release = version - result.DiscoveredBy = "os-release" + result.DiscoveredBy = "/etc/os-release" switch osID { - case "rhel": - result.Distribution = RedHat case "fedora": result.Distribution = Fedora case "centos": diff --git a/cmd/prerequisites.go b/cmd/prerequisites.go index affe16b0..e5c7533a 100644 --- a/cmd/prerequisites.go +++ b/cmd/prerequisites.go @@ -49,15 +49,30 @@ func getRequiredProgramsLinux() *Prerequisites { result := &Prerequisites{} distroInfo := GetLinuxDistroInfo() switch distroInfo.Distribution { - case Ubuntu, Debian, Zorin: + case Debian: + result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again")) + result.Add(newPrerequisite("pkg-config", "Please install with `sudo apt install pkg-config` and try again")) + result.Add(newPrerequisite("npm", "Please install with `curl -sL https://deb.nodesource.com/setup_12.x | sudo bash - && sudo apt-get install -y nodejs` and try again")) + case Ubuntu: + result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again")) + result.Add(newPrerequisite("pkg-config", "Please install with `sudo apt install pkg-config` and try again")) + result.Add(newPrerequisite("npm", "Please install with `curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - && sudo apt-get install -y nodejs` and try again")) + case Zorin: result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again")) result.Add(newPrerequisite("pkg-config", "Please install with `sudo apt install pkg-config` and try again")) result.Add(newPrerequisite("npm", "Please install with `sudo snap install node --channel=12/stable --classic` and try again")) + case Fedora: + result.Add(newPrerequisite("gcc", "Please install with `sudo yum install gcc-c++ make` and try again")) + result.Add(newPrerequisite("pkg-config", "Please install with `sudo yum install pkgconf-pkg-config` and try again")) + result.Add(newPrerequisite("npm", "Please install with `curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash - && sudo yum install -y nodejs` and try again")) + case CentOS: + result.Add(newPrerequisite("gcc", "Please install with `sudo yum install gcc gcc-c++ make` and try again")) + result.Add(newPrerequisite("pkg-config", "Please install with `sudo yum install pkgconfig` and try again")) + result.Add(newPrerequisite("npm", "Please install with `curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash - && sudo yum install -y nodejs` and try again")) default: result.Add(newPrerequisite("gcc", "Please install with your system package manager and try again")) result.Add(newPrerequisite("pkg-config", "Please install with your system package manager and try again")) result.Add(newPrerequisite("npm", "Please install from https://nodejs.org/en/download/ and try again")) - } return result } @@ -93,7 +108,13 @@ func getRequiredLibrariesLinux() (*Prerequisites, error) { result := &Prerequisites{} distroInfo := GetLinuxDistroInfo() switch distroInfo.Distribution { - case Ubuntu, Debian, Zorin: + case Debian: + result.Add(newPrerequisite("libgtk-3-dev", "Please install with `sudo apt install libgtk-3-dev` and try again")) + result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with `sudo apt install libwebkit2gtk-4.0-dev` and try again")) + case Ubuntu: + result.Add(newPrerequisite("libgtk-3-dev", "Please install with `sudo apt install libgtk-3-dev` and try again")) + result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with `sudo apt install libwebkit2gtk-4.0-dev` and try again")) + case Zorin: result.Add(newPrerequisite("libgtk-3-dev", "Please install with `sudo apt install libgtk-3-dev` and try again")) result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with `sudo apt install libwebkit2gtk-4.0-dev` and try again")) case Gentoo: @@ -102,9 +123,12 @@ func getRequiredLibrariesLinux() (*Prerequisites, error) { case Arch: result.Add(newPrerequisite("gtk3", "Please install with `sudo pacman -S gtk3` and try again")) result.Add(newPrerequisite("webkit2gtk", "Please install with `sudo pacman -S webkit2gtk` and try again")) - case RedHat, Fedora, CentOS: + case Fedora: result.Add(newPrerequisite("gtk3-devel", "Please install with `sudo yum install gtk3-devel` and try again")) result.Add(newPrerequisite("webkit2gtk3-devel", "Please install with `sudo yum install webkit2gtk3-devel` and try again")) + case CentOS: + result.Add(newPrerequisite("gtk3-devel", "Please install with `sudo yum install gtk3-devel` and try again")) + result.Add(newPrerequisite("webkitgtk3-devel", "Please install with `sudo yum install webkitgtk3-devel` and try again")) default: result.Add(newPrerequisite("libgtk-3-dev", "Please install with your system package manager and try again")) result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with your system package manager and try again")) From ddec01a42915a0abf7d009df62391c5bb11ed1a9 Mon Sep 17 00:00:00 2001 From: bh90210 Date: Mon, 29 Jul 2019 23:53:43 +0300 Subject: [PATCH 02/11] feat: gcc,npm,node versions on issues --- .../angular-template/frontend/npm-debug.log | 46 +++++++++++++++++++ cmd/wails/9_issue.go | 25 ++++++++++ 2 files changed, 71 insertions(+) create mode 100644 cmd/templates/angular-template/frontend/npm-debug.log diff --git a/cmd/templates/angular-template/frontend/npm-debug.log b/cmd/templates/angular-template/frontend/npm-debug.log new file mode 100644 index 00000000..64c9f05c --- /dev/null +++ b/cmd/templates/angular-template/frontend/npm-debug.log @@ -0,0 +1,46 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ] +2 info using npm@3.5.2 +3 info using node@v8.10.0 +4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] +5 info lifecycle my-app@0.0.0~prebuild: my-app@0.0.0 +6 silly lifecycle my-app@0.0.0~prebuild: no script for prebuild, continuing +7 info lifecycle my-app@0.0.0~build: my-app@0.0.0 +8 verbose lifecycle my-app@0.0.0~build: unsafe-perm in lifecycle true +9 verbose lifecycle my-app@0.0.0~build: PATH: /usr/share/npm/bin/node-gyp-bin:/home/bh90210/wails-angular/frontend/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/usr/local/go/bin:/home/bh90210/go/bin +10 verbose lifecycle my-app@0.0.0~build: CWD: /home/bh90210/wails-angular/frontend +11 silly lifecycle my-app@0.0.0~build: Args: [ '-c', +11 silly lifecycle 'npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false' ] +12 silly lifecycle my-app@0.0.0~build: Returned: code: 3 signal: null +13 info lifecycle my-app@0.0.0~build: Failed to exec build script +14 verbose stack Error: my-app@0.0.0 build: `npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false` +14 verbose stack Exit status 3 +14 verbose stack at EventEmitter. (/usr/share/npm/lib/utils/lifecycle.js:232:16) +14 verbose stack at emitTwo (events.js:126:13) +14 verbose stack at EventEmitter.emit (events.js:214:7) +14 verbose stack at ChildProcess. (/usr/share/npm/lib/utils/spawn.js:24:14) +14 verbose stack at emitTwo (events.js:126:13) +14 verbose stack at ChildProcess.emit (events.js:214:7) +14 verbose stack at maybeClose (internal/child_process.js:925:16) +14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) +15 verbose pkgid my-app@0.0.0 +16 verbose cwd /home/bh90210/wails-angular/frontend +17 error Linux 4.18.0-22-generic +18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "build" +19 error node v8.10.0 +20 error npm v3.5.2 +21 error code ELIFECYCLE +22 error my-app@0.0.0 build: `npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false` +22 error Exit status 3 +23 error Failed at the my-app@0.0.0 build script 'npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false'. +23 error Make sure you have the latest version of node.js and npm installed. +23 error If you do, this is most likely a problem with the my-app package, +23 error not with npm itself. +23 error Tell the author that this fails on your system: +23 error npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false +23 error You can get information on how to open an issue for this project with: +23 error npm bugs my-app +23 error Or if that isn't available, you can get their info via: +23 error npm owner ls my-app +23 error There is likely additional logging output above. +24 verbose exit [ 1, true ] diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index 596363c8..ed735679 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -42,12 +42,37 @@ To help you in this process, we will ask for some information, add Go/Wails deta gomodule = "(Not Set)" } + // Get versions for GCC, node & npm + program := cmd.NewProgramHelper() + var gccVersion, nodeVersion, npmVersion string + + gcc := program.FindProgram("gcc") + if gcc != nil { + stdout, _, _, _ := gcc.Run("--version") + gccVersion = stdout + } + + npm := program.FindProgram("npm") + if npm != nil { + stdout, _, _, _ := npm.Run("--version") + nodeVersion = stdout + } + + node := program.FindProgram("node") + if node != nil { + stdout, _, _, _ := node.Run("--version") + npmVersion = stdout + } + str.WriteString("\n| Name | Value |\n| ----- | ----- |\n") str.WriteString(fmt.Sprintf("| Wails Version | %s |\n", cmd.Version)) str.WriteString(fmt.Sprintf("| Go Version | %s |\n", runtime.Version())) str.WriteString(fmt.Sprintf("| Platform | %s |\n", runtime.GOOS)) str.WriteString(fmt.Sprintf("| Arch | %s |\n", runtime.GOARCH)) str.WriteString(fmt.Sprintf("| GO111MODULE | %s |\n", gomodule)) + str.WriteString(fmt.Sprintf("| Gcc | %s |\n", gccVersion)) + str.WriteString(fmt.Sprintf("| Npm | %s |\n", npmVersion)) + str.WriteString(fmt.Sprintf("| Node | %s |\n", nodeVersion)) fmt.Println() fmt.Println("Processing template and preparing for upload.") From 6e81a36adaca544cf4f1649367b29bb24e3ee3e4 Mon Sep 17 00:00:00 2001 From: bh90210 Date: Tue, 30 Jul 2019 02:02:01 +0300 Subject: [PATCH 03/11] linux working --- cmd/wails/9_issue.go | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index ed735679..a4c64c7e 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -6,6 +6,7 @@ import ( "net/http" "net/url" "os" + "os/exec" "runtime" "strings" @@ -46,22 +47,29 @@ To help you in this process, we will ask for some information, add Go/Wails deta program := cmd.NewProgramHelper() var gccVersion, nodeVersion, npmVersion string - gcc := program.FindProgram("gcc") - if gcc != nil { - stdout, _, _, _ := gcc.Run("--version") - gccVersion = stdout - } + //gcc := program.FindProgram("gcc") + //if gcc != nil { + // stdout, _, _, _ := gcc.Run("--version", "|", "sed", "'s/[^0-9.]*\\([0-9.]*\\).*/\\1/'", "|", "grep", "-m1", "''") + // gccVersion = stdout + //} + + gccCmd := "gcc --version | sed 's/[^0-9.]*\\([0-9.]*\\).*/\\1/' | grep -m1 ''" + gcc, _ := exec.Command("bash", "-c", gccCmd).Output() + gccVersion = string(gcc) + gccVersion = gccVersion[:len(gccVersion)-1] npm := program.FindProgram("npm") if npm != nil { stdout, _, _, _ := npm.Run("--version") nodeVersion = stdout + nodeVersion = nodeVersion[:len(nodeVersion)-1] } node := program.FindProgram("node") if node != nil { stdout, _, _, _ := node.Run("--version") npmVersion = stdout + npmVersion = npmVersion[:len(npmVersion)-1] } str.WriteString("\n| Name | Value |\n| ----- | ----- |\n") @@ -70,9 +78,9 @@ To help you in this process, we will ask for some information, add Go/Wails deta str.WriteString(fmt.Sprintf("| Platform | %s |\n", runtime.GOOS)) str.WriteString(fmt.Sprintf("| Arch | %s |\n", runtime.GOARCH)) str.WriteString(fmt.Sprintf("| GO111MODULE | %s |\n", gomodule)) - str.WriteString(fmt.Sprintf("| Gcc | %s |\n", gccVersion)) - str.WriteString(fmt.Sprintf("| Npm | %s |\n", npmVersion)) - str.WriteString(fmt.Sprintf("| Node | %s |\n", nodeVersion)) + str.WriteString(fmt.Sprintf("| GCC | %s |\n", gccVersion)) + str.WriteString(fmt.Sprintf("| Npm | %s |\n", npmVersion)) + str.WriteString(fmt.Sprintf("| Node | %s |\n", nodeVersion)) fmt.Println() fmt.Println("Processing template and preparing for upload.") From 3f657b34cfe9be3b1b22740e427425782ed0e076 Mon Sep 17 00:00:00 2001 From: bh90210 Date: Tue, 30 Jul 2019 02:12:51 +0300 Subject: [PATCH 04/11] darwin working --- cmd/wails/9_issue.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index a4c64c7e..afb2404e 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -53,10 +53,18 @@ To help you in this process, we will ask for some information, add Go/Wails deta // gccVersion = stdout //} - gccCmd := "gcc --version | sed 's/[^0-9.]*\\([0-9.]*\\).*/\\1/' | grep -m1 ''" - gcc, _ := exec.Command("bash", "-c", gccCmd).Output() - gccVersion = string(gcc) - gccVersion = gccVersion[:len(gccVersion)-1] + switch runtime.GOOS { + case "darwin": + gccCmd := "gcc -dumpversion | cut -f1,2,3 -d." + gcc, _ := exec.Command("bash", "-c", gccCmd).Output() + gccVersion = string(gcc) + //gccVersion = gccVersion[:len(gccVersion)-1] + case "linux": + gccCmd := "gcc --version | sed 's/[^0-9.]*\\([0-9.]*\\).*/\\1/' | grep -m1 ''" + gcc, _ := exec.Command("bash", "-c", gccCmd).Output() + gccVersion = string(gcc) + gccVersion = gccVersion[:len(gccVersion)-1] + } npm := program.FindProgram("npm") if npm != nil { From b9b42c059e8677c95733cdf9c87700e8ad96e552 Mon Sep 17 00:00:00 2001 From: bh90210 Date: Tue, 30 Jul 2019 15:57:51 +0300 Subject: [PATCH 05/11] feat: show gcc, node, npm version on issue report --- cmd/wails/9_issue.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index afb2404e..77ee8de8 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -6,7 +6,6 @@ import ( "net/http" "net/url" "os" - "os/exec" "runtime" "strings" @@ -47,23 +46,24 @@ To help you in this process, we will ask for some information, add Go/Wails deta program := cmd.NewProgramHelper() var gccVersion, nodeVersion, npmVersion string - //gcc := program.FindProgram("gcc") - //if gcc != nil { - // stdout, _, _, _ := gcc.Run("--version", "|", "sed", "'s/[^0-9.]*\\([0-9.]*\\).*/\\1/'", "|", "grep", "-m1", "''") - // gccVersion = stdout - //} - switch runtime.GOOS { case "darwin": - gccCmd := "gcc -dumpversion | cut -f1,2,3 -d." - gcc, _ := exec.Command("bash", "-c", gccCmd).Output() - gccVersion = string(gcc) - //gccVersion = gccVersion[:len(gccVersion)-1] + gcc := program.FindProgram("gcc") + if gcc != nil { + stdout, _, _, _ := gcc.Run("-dumpversion") + gccVersion = stdout + // TODO: check if linefeed needs stripping or what kind + // gccVersion = gccVersion[:len(nodeVersion)-1] + } case "linux": - gccCmd := "gcc --version | sed 's/[^0-9.]*\\([0-9.]*\\).*/\\1/' | grep -m1 ''" - gcc, _ := exec.Command("bash", "-c", gccCmd).Output() - gccVersion = string(gcc) - gccVersion = gccVersion[:len(gccVersion)-1] + gcc := program.FindProgram("gcc") + if gcc != nil { + stdout, _, _, _ := gcc.Run("-dumpfullversion") + gccVersion = stdout + gccVersion = gccVersion[:len(nodeVersion)-1] + } + + // TODO: windows support } npm := program.FindProgram("npm") From 6c8d34dfd3876e80b8aedda4aec54cc33711ab36 Mon Sep 17 00:00:00 2001 From: "admin_3.exe" Date: Tue, 30 Jul 2019 16:00:16 +0300 Subject: [PATCH 06/11] Delete npm-debug.log --- .../angular-template/frontend/npm-debug.log | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 cmd/templates/angular-template/frontend/npm-debug.log diff --git a/cmd/templates/angular-template/frontend/npm-debug.log b/cmd/templates/angular-template/frontend/npm-debug.log deleted file mode 100644 index 64c9f05c..00000000 --- a/cmd/templates/angular-template/frontend/npm-debug.log +++ /dev/null @@ -1,46 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ] -2 info using npm@3.5.2 -3 info using node@v8.10.0 -4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] -5 info lifecycle my-app@0.0.0~prebuild: my-app@0.0.0 -6 silly lifecycle my-app@0.0.0~prebuild: no script for prebuild, continuing -7 info lifecycle my-app@0.0.0~build: my-app@0.0.0 -8 verbose lifecycle my-app@0.0.0~build: unsafe-perm in lifecycle true -9 verbose lifecycle my-app@0.0.0~build: PATH: /usr/share/npm/bin/node-gyp-bin:/home/bh90210/wails-angular/frontend/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/usr/local/go/bin:/home/bh90210/go/bin -10 verbose lifecycle my-app@0.0.0~build: CWD: /home/bh90210/wails-angular/frontend -11 silly lifecycle my-app@0.0.0~build: Args: [ '-c', -11 silly lifecycle 'npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false' ] -12 silly lifecycle my-app@0.0.0~build: Returned: code: 3 signal: null -13 info lifecycle my-app@0.0.0~build: Failed to exec build script -14 verbose stack Error: my-app@0.0.0 build: `npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false` -14 verbose stack Exit status 3 -14 verbose stack at EventEmitter. (/usr/share/npm/lib/utils/lifecycle.js:232:16) -14 verbose stack at emitTwo (events.js:126:13) -14 verbose stack at EventEmitter.emit (events.js:214:7) -14 verbose stack at ChildProcess. (/usr/share/npm/lib/utils/spawn.js:24:14) -14 verbose stack at emitTwo (events.js:126:13) -14 verbose stack at ChildProcess.emit (events.js:214:7) -14 verbose stack at maybeClose (internal/child_process.js:925:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) -15 verbose pkgid my-app@0.0.0 -16 verbose cwd /home/bh90210/wails-angular/frontend -17 error Linux 4.18.0-22-generic -18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "build" -19 error node v8.10.0 -20 error npm v3.5.2 -21 error code ELIFECYCLE -22 error my-app@0.0.0 build: `npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false` -22 error Exit status 3 -23 error Failed at the my-app@0.0.0 build script 'npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false'. -23 error Make sure you have the latest version of node.js and npm installed. -23 error If you do, this is most likely a problem with the my-app package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false -23 error You can get information on how to open an issue for this project with: -23 error npm bugs my-app -23 error Or if that isn't available, you can get their info via: -23 error npm owner ls my-app -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ] From 6c945a4eede9f5ff09d4d9c03f2935734032c715 Mon Sep 17 00:00:00 2001 From: bh90210 Date: Tue, 30 Jul 2019 16:11:18 +0300 Subject: [PATCH 07/11] fix: crashing typo --- cmd/wails/9_issue.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index 77ee8de8..c74d350e 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -53,14 +53,14 @@ To help you in this process, we will ask for some information, add Go/Wails deta stdout, _, _, _ := gcc.Run("-dumpversion") gccVersion = stdout // TODO: check if linefeed needs stripping or what kind - // gccVersion = gccVersion[:len(nodeVersion)-1] + // gccVersion = gccVersion[:len(gccVersion)-1] } case "linux": gcc := program.FindProgram("gcc") if gcc != nil { stdout, _, _, _ := gcc.Run("-dumpfullversion") gccVersion = stdout - gccVersion = gccVersion[:len(nodeVersion)-1] + gccVersion = gccVersion[:len(gccVersion)-1] } // TODO: windows support From 5cb00eb481c34cb53830267cedce5bae5d22afab Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Wed, 31 Jul 2019 06:08:43 +1000 Subject: [PATCH 08/11] trim gcc string --- cmd/wails/9_issue.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index c74d350e..3bc77977 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -51,16 +51,14 @@ To help you in this process, we will ask for some information, add Go/Wails deta gcc := program.FindProgram("gcc") if gcc != nil { stdout, _, _, _ := gcc.Run("-dumpversion") - gccVersion = stdout - // TODO: check if linefeed needs stripping or what kind - // gccVersion = gccVersion[:len(gccVersion)-1] + gccVersion = strings.TrimSpace(stdout) } case "linux": gcc := program.FindProgram("gcc") if gcc != nil { - stdout, _, _, _ := gcc.Run("-dumpfullversion") - gccVersion = stdout + gccVersion, _, _, _ := gcc.Run("-dumpfullversion") gccVersion = gccVersion[:len(gccVersion)-1] + gccVersion = strings.TrimSpace(gccVersion) } // TODO: windows support From 33daa8621e0c0e43e84ff76156496e8e0747085b Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Wed, 31 Jul 2019 06:21:00 +1000 Subject: [PATCH 09/11] chore: version bump --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index 6e06c26d..2f0832c4 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -1,4 +1,4 @@ package cmd // Version - Wails version -const Version = "v0.17.7-pre" +const Version = "v0.17.8-pre" From bb86d770a1a331a1b9e5bc9819d58532d3c759b9 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Wed, 31 Jul 2019 06:54:07 +1000 Subject: [PATCH 10/11] fix: gitbash fixes --- cmd/prompt.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cmd/prompt.go b/cmd/prompt.go index 3a3adba4..dac324fe 100644 --- a/cmd/prompt.go +++ b/cmd/prompt.go @@ -4,7 +4,6 @@ import ( "bufio" "fmt" "os" - "runtime" "strconv" "strings" ) @@ -20,11 +19,7 @@ func Prompt(question string, defaultValue ...string) string { fmt.Printf(question + ": ") reader := bufio.NewReader(os.Stdin) input, _ := reader.ReadString('\n') - EOL := "\n" - if runtime.GOOS == "windows" { - EOL = "\r\n" - } - input = strings.Replace(input, EOL, "", -1) + input = strings.TrimSpace(input) if input != "" { answer = input From ed3ed8aa1857296d959cdcf6522cf3ea19432ac3 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Wed, 31 Jul 2019 06:57:56 +1000 Subject: [PATCH 11/11] chore: hotfix --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index 2f0832c4..78c1333e 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -1,4 +1,4 @@ package cmd // Version - Wails version -const Version = "v0.17.8-pre" +const Version = "v0.17.9-pre"