
godep restore pushd $GOPATH/src/github.com/appc/spec git co master popd go get go4.org/errorutil rm -rf Godeps godep save ./... git add vendor git add -f $(git ls-files --other vendor/) git co -- Godeps/LICENSES Godeps/.license_file_state Godeps/OWNERS
39 lines
817 B
Go
39 lines
817 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os/exec"
|
|
)
|
|
|
|
func BuildUnfocusCommand() *Command {
|
|
return &Command{
|
|
Name: "unfocus",
|
|
AltName: "blur",
|
|
FlagSet: flag.NewFlagSet("unfocus", flag.ExitOnError),
|
|
UsageCommand: "ginkgo unfocus (or ginkgo blur)",
|
|
Usage: []string{
|
|
"Recursively unfocuses any focused tests under the current directory",
|
|
},
|
|
Command: unfocusSpecs,
|
|
}
|
|
}
|
|
|
|
func unfocusSpecs([]string, []string) {
|
|
unfocus("Describe")
|
|
unfocus("Context")
|
|
unfocus("It")
|
|
unfocus("Measure")
|
|
unfocus("DescribeTable")
|
|
unfocus("Entry")
|
|
}
|
|
|
|
func unfocus(component string) {
|
|
fmt.Printf("Removing F%s...\n", component)
|
|
cmd := exec.Command("gofmt", fmt.Sprintf("-r=F%s -> %s", component, component), "-w", ".")
|
|
out, _ := cmd.CombinedOutput()
|
|
if string(out) != "" {
|
|
println(string(out))
|
|
}
|
|
}
|