mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #4360 from a-robinson/yaml
Remove the now-unused open-golang dependency. It was only being used by kubecfg
This commit is contained in:
commit
8c5f77f302
4
Godeps/Godeps.json
generated
4
Godeps/Godeps.json
generated
@ -206,10 +206,6 @@
|
|||||||
"Comment": "v1.0.0",
|
"Comment": "v1.0.0",
|
||||||
"Rev": "da56de6a59e53fdd61be1b5d9b87df34c47ac420"
|
"Rev": "da56de6a59e53fdd61be1b5d9b87df34c47ac420"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"ImportPath": "github.com/skratchdot/open-golang/open",
|
|
||||||
"Rev": "ba570a111973b539baf23c918213059543b5bb6e"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/skynetservices/skydns/msg",
|
"ImportPath": "github.com/skynetservices/skydns/msg",
|
||||||
"Comment": "2.0.1d-2-g245a121",
|
"Comment": "2.0.1d-2-g245a121",
|
||||||
|
15
Godeps/_workspace/src/github.com/skratchdot/open-golang/open/exec.go
generated
vendored
15
Godeps/_workspace/src/github.com/skratchdot/open-golang/open/exec.go
generated
vendored
@ -1,15 +0,0 @@
|
|||||||
// +build !windows,!darwin
|
|
||||||
|
|
||||||
package open
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os/exec"
|
|
||||||
)
|
|
||||||
|
|
||||||
func open(input string) *exec.Cmd {
|
|
||||||
return exec.Command("xdg-open", input)
|
|
||||||
}
|
|
||||||
|
|
||||||
func openWith(input string, appName string) *exec.Cmd {
|
|
||||||
return exec.Command(appName, input)
|
|
||||||
}
|
|
15
Godeps/_workspace/src/github.com/skratchdot/open-golang/open/exec_darwin.go
generated
vendored
15
Godeps/_workspace/src/github.com/skratchdot/open-golang/open/exec_darwin.go
generated
vendored
@ -1,15 +0,0 @@
|
|||||||
// +build darwin
|
|
||||||
|
|
||||||
package open
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os/exec"
|
|
||||||
)
|
|
||||||
|
|
||||||
func open(input string) *exec.Cmd {
|
|
||||||
return exec.Command("open", input)
|
|
||||||
}
|
|
||||||
|
|
||||||
func openWith(input string, appName string) *exec.Cmd {
|
|
||||||
return exec.Command("open", "-a", appName, input)
|
|
||||||
}
|
|
21
Godeps/_workspace/src/github.com/skratchdot/open-golang/open/exec_windows.go
generated
vendored
21
Godeps/_workspace/src/github.com/skratchdot/open-golang/open/exec_windows.go
generated
vendored
@ -1,21 +0,0 @@
|
|||||||
// +build windows
|
|
||||||
|
|
||||||
package open
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os/exec"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
func cleaninput(input string) string {
|
|
||||||
r := strings.NewReplacer("&", "^&")
|
|
||||||
return r.Replace(input)
|
|
||||||
}
|
|
||||||
|
|
||||||
func open(input string) *exec.Cmd {
|
|
||||||
return exec.Command("cmd", "/C", "start", "", cleaninput(input))
|
|
||||||
}
|
|
||||||
|
|
||||||
func openWith(input string, appName string) *exec.Cmd {
|
|
||||||
return exec.Command("cmd", "/C", "start", "", appName, cleaninput(input))
|
|
||||||
}
|
|
50
Godeps/_workspace/src/github.com/skratchdot/open-golang/open/open.go
generated
vendored
50
Godeps/_workspace/src/github.com/skratchdot/open-golang/open/open.go
generated
vendored
@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
Open a file, directory, or URI using the OS's default
|
|
||||||
application for that object type. Optionally, you can
|
|
||||||
specify an application to use.
|
|
||||||
|
|
||||||
This is a proxy for the following commands:
|
|
||||||
|
|
||||||
OSX: "open"
|
|
||||||
Windows: "start"
|
|
||||||
Linux/Other: "xdg-open"
|
|
||||||
|
|
||||||
This is a golang port of the node.js module: https://github.com/pwnall/node-open
|
|
||||||
|
|
||||||
*/
|
|
||||||
package open
|
|
||||||
|
|
||||||
/*
|
|
||||||
Open a file, directory, or URI using the OS's default
|
|
||||||
application for that object type. Wait for the open
|
|
||||||
command to complete.
|
|
||||||
*/
|
|
||||||
func Run(input string) error {
|
|
||||||
return open(input).Run()
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Open a file, directory, or URI using the OS's default
|
|
||||||
application for that object type. Don't wait for the
|
|
||||||
open command to complete.
|
|
||||||
*/
|
|
||||||
func Start(input string) error {
|
|
||||||
return open(input).Start()
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Open a file, directory, or URI using the specified application.
|
|
||||||
Wait for the open command to complete.
|
|
||||||
*/
|
|
||||||
func RunWith(input string, appName string) error {
|
|
||||||
return openWith(input, appName).Run()
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Open a file, directory, or URI using the specified application.
|
|
||||||
Don't wait for the open command to complete.
|
|
||||||
*/
|
|
||||||
func StartWith(input string, appName string) error {
|
|
||||||
return openWith(input, appName).Start()
|
|
||||||
}
|
|
70
Godeps/_workspace/src/github.com/skratchdot/open-golang/open/open_test.go
generated
vendored
70
Godeps/_workspace/src/github.com/skratchdot/open-golang/open/open_test.go
generated
vendored
@ -1,70 +0,0 @@
|
|||||||
package open
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestRun(t *testing.T) {
|
|
||||||
// shouldn't error
|
|
||||||
input := "https://google.com/"
|
|
||||||
err := Run(input)
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("open.Run(\"%s\") threw an error: %s", input, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// should error
|
|
||||||
input = "xxxxxxxxxxxxxxx"
|
|
||||||
err = Run(input)
|
|
||||||
if err == nil {
|
|
||||||
t.Errorf("Run(\"%s\") did not throw an error as expected", input)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestStart(t *testing.T) {
|
|
||||||
// shouldn't error
|
|
||||||
input := "https://google.com/"
|
|
||||||
err := Start(input)
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("open.Start(\"%s\") threw an error: %s", input, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// shouldn't error
|
|
||||||
input = "xxxxxxxxxxxxxxx"
|
|
||||||
err = Start(input)
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("open.Start(\"%s\") shouldn't even fail on invalid input: %s", input, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestRunWith(t *testing.T) {
|
|
||||||
// shouldn't error
|
|
||||||
input := "https://google.com/"
|
|
||||||
app := "firefox"
|
|
||||||
err := RunWith(input, app)
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("open.RunWith(\"%s\", \"%s\") threw an error: %s", input, app, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// should error
|
|
||||||
app = "xxxxxxxxxxxxxxx"
|
|
||||||
err = RunWith(input, app)
|
|
||||||
if err == nil {
|
|
||||||
t.Errorf("RunWith(\"%s\", \"%s\") did not throw an error as expected", input, app)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestStartWith(t *testing.T) {
|
|
||||||
// shouldn't error
|
|
||||||
input := "https://google.com/"
|
|
||||||
app := "firefox"
|
|
||||||
err := StartWith(input, app)
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("open.StartWith(\"%s\", \"%s\") threw an error: %s", input, app, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// shouldn't error
|
|
||||||
input = "[<Invalid URL>]"
|
|
||||||
err = StartWith(input, app)
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("StartWith(\"%s\", \"%s\") shouldn't even fail on invalid input: %s", input, app, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user