Closed es-elektron closed 7 years ago
How best to install this on OSX? I only see Ubuntu instructions.
Hey,
could you try go get github.com/erning/gorun
?
Best chris
Hey guys, didn't want to open a separate issue as I think this is exactly the same issue. I'm on macOS Sierra v10.12.5 and I'm using BitBar v1.9.2
I have installed gorun
by running go get github.com/erning/gorun
, it's installed correctly and I can execute the following script test.1m.go
:
#!/usr/bin/env gorun
package main
import (
"fmt"
)
func main() {
fmt.Println("hello friend")
}
When I run the script I get the expected output:
However, I'm seeing this in the bitbar:
Can you please give an advice, what I'm doing wrong?
I managed to get it to work by creating a bash script that runs gorun
after exporting PATH
with GOPATH
before running it and pointing it to the test script like this:
#!/usr/bin/env bash
export GOPATH=$HOME/dev/go_workspace
export PATH=$HOME/bin:/usr/local/bin:$GOPATH/bin
gorun $HOME/dev/bitbar/test.1m.sh
Even though this is working, is there a way how to avoid creating a bash script, exporting GOPATH and PATH and then executing the scrip by giving the full path to the script? The other way is to create a valid go app, and then execute it by name after installing it, so you would have something like this in the bash script, where test
is the installed go app:
#!/usr/bin/env bash
export GOPATH=$HOME/dev/go_workspace
export PATH=$HOME/bin:/usr/local/bin:$GOPATH/bin
test
Actually you can run a compiled go program without an additional bash script, You just have to use the .cgo ending.
So the file should look something like this:
checkhosts.1m.cgo
FAO: (@christophschlosser)
Trying to run 'checkhosts.1m.go.txt' but I get "env: gorun: No such file or directory".