mirror of https://github.com/docker/docs.git
This code is only useful to crash reports
Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
parent
7442ccc585
commit
af09ebbe4e
|
|
@ -17,7 +17,6 @@ import (
|
||||||
|
|
||||||
"github.com/bugsnag/bugsnag-go"
|
"github.com/bugsnag/bugsnag-go"
|
||||||
"github.com/docker/machine/libmachine/log"
|
"github.com/docker/machine/libmachine/log"
|
||||||
"github.com/docker/machine/libmachine/mcnutils"
|
|
||||||
"github.com/docker/machine/version"
|
"github.com/docker/machine/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -146,5 +145,5 @@ func detectUname(metaData *bugsnag.MetaData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func detectOSVersion(metaData *bugsnag.MetaData) {
|
func detectOSVersion(metaData *bugsnag.MetaData) {
|
||||||
metaData.Add("device", "os version", mcnutils.LocalOSVersion())
|
metaData.Add("device", "os version", localOSVersion())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package mcnutils
|
package crashreport
|
||||||
|
|
||||||
import "os/exec"
|
import "os/exec"
|
||||||
|
|
||||||
func LocalOSVersion() string {
|
func localOSVersion() string {
|
||||||
command := exec.Command("bash", "-c", `sw_vers | grep ProductVersion | cut -d$'\t' -f2`)
|
command := exec.Command("bash", "-c", `sw_vers | grep ProductVersion | cut -d$'\t' -f2`)
|
||||||
output, err := command.Output()
|
output, err := command.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package mcnutils
|
package crashreport
|
||||||
|
|
||||||
import "os/exec"
|
import "os/exec"
|
||||||
|
|
||||||
func LocalOSVersion() string {
|
func localOSVersion() string {
|
||||||
command := exec.Command("bash", "-c", `cat /etc/os-release | grep 'VERSION=' | cut -d'=' -f2`)
|
command := exec.Command("bash", "-c", `cat /etc/os-release | grep 'VERSION=' | cut -d'=' -f2`)
|
||||||
output, err := command.Output()
|
output, err := command.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package mcnutils
|
package crashreport
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func LocalOSVersion() string {
|
func localOSVersion() string {
|
||||||
command := exec.Command("ver")
|
command := exec.Command("ver")
|
||||||
output, err := command.Output()
|
output, err := command.Output()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package mcnutils
|
package crashreport
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
Loading…
Reference in New Issue