Skip to content

Instantly share code, notes, and snippets.

@natrim
Last active February 16, 2017 10:44
Show Gist options
  • Save natrim/04a0324ca6898619fad5579ef1facb68 to your computer and use it in GitHub Desktop.
Save natrim/04a0324ca6898619fad5579ef1facb68 to your computer and use it in GitHub Desktop.
package main
import (
"os"
"os/exec"
"path"
"path/filepath"
)
func main() {
// get the app path
dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
if err != nil {
println(err.Error())
os.Exit(1)
}
// execute the real binary with all args
cmd := exec.Command(path.Join(dir, "WebCatalog_Real"), os.Args...)
out, err := cmd.Output()
if err != nil {
println(err.Error())
return
}
// spit out real output
print(string(out))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment