mirror of
https://github.com/docker/docs.git
synced 2026-11-06 12:54:24 +03:00
This code is only useful to crash reports
Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
@@ -17,7 +17,6 @@ import (
|
||||
|
||||
"github.com/bugsnag/bugsnag-go"
|
||||
"github.com/docker/machine/libmachine/log"
|
||||
"github.com/docker/machine/libmachine/mcnutils"
|
||||
"github.com/docker/machine/version"
|
||||
)
|
||||
|
||||
@@ -146,5 +145,5 @@ func detectUname(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"
|
||||
|
||||
func LocalOSVersion() string {
|
||||
func localOSVersion() string {
|
||||
command := exec.Command("bash", "-c", `sw_vers | grep ProductVersion | cut -d$'\t' -f2`)
|
||||
output, err := command.Output()
|
||||
if err != nil {
|
||||
@@ -1,8 +1,8 @@
|
||||
package mcnutils
|
||||
package crashreport
|
||||
|
||||
import "os/exec"
|
||||
|
||||
func LocalOSVersion() string {
|
||||
func localOSVersion() string {
|
||||
command := exec.Command("bash", "-c", `cat /etc/os-release | grep 'VERSION=' | cut -d'=' -f2`)
|
||||
output, err := command.Output()
|
||||
if err != nil {
|
||||
@@ -1,11 +1,11 @@
|
||||
package mcnutils
|
||||
package crashreport
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func LocalOSVersion() string {
|
||||
func localOSVersion() string {
|
||||
command := exec.Command("ver")
|
||||
output, err := command.Output()
|
||||
if err == nil {
|
||||
@@ -1,4 +1,4 @@
|
||||
package mcnutils
|
||||
package crashreport
|
||||
|
||||
import (
|
||||
"testing"
|
||||
Reference in New Issue
Block a user