Skip to content

Commit

Permalink
Removed all coloured output and related dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
nomad-software committed Aug 4, 2020
1 parent dc54ecb commit bb65bee
Show file tree
Hide file tree
Showing 502 changed files with 9 additions and 274,951 deletions.
4 changes: 1 addition & 3 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package cli
import (
"flag"
"fmt"

"github.com/fatih/color"
)

// Options contains CLI arguments passed to the program.
Expand Down Expand Up @@ -34,7 +32,7 @@ __ _____ _ __ __| |
`

color.Green(banner)
fmt.Println(banner)
fmt.Printf("A small command line utility for fully vendoring module dependencies\n\n")

flag.Usage()
Expand Down
6 changes: 3 additions & 3 deletions file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func InitVendorDir() VendorDir {
}

if !v.exists(v.basePath) {
output.Error("No dependencies vendored")
output.Fatal("vend: no dependencies to vendor")
}

return v
Expand All @@ -43,13 +43,13 @@ func (v *VendorDir) CopyDependencies() {
v.clear()

for _, d := range v.deps {
fmt.Fprintf(output.Stdout, "vend: copying %s (%s)\n", d.Path, d.Version)
fmt.Printf("vend: copying %s (%s)\n", d.Path, d.Version)
v.copy(d.Dir, v.vendPath(d.Path))
}

for _, r := range v.mod.Replace {
if r.Old.Path != r.New.Path {
fmt.Fprintf(output.Stdout, "vend: replacing %s with %s\n", r.Old.Path, r.New.Path)
fmt.Printf("vend: replacing %s with %s\n", r.Old.Path, r.New.Path)
newPath := v.vendPath(r.New.Path)
oldPath := v.vendPath(r.Old.Path)
// If the directory is in the vendor folder it was copied from the
Expand Down
5 changes: 0 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
module github.com/nomad-software/vend

go 1.15

require (
github.com/fatih/color v1.9.0
github.com/mattn/go-colorable v0.1.7
)
14 changes: 0 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,14 +0,0 @@
github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw=
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
21 changes: 5 additions & 16 deletions output/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,22 @@ package output
import (
"fmt"
"os"

"github.com/fatih/color"
"github.com/mattn/go-colorable"
)

var (
// Stdout is a color friendly pipe.
Stdout = colorable.NewColorableStdout()

// Stderr is a color friendly pipe.
Stderr = colorable.NewColorableStderr()
)

// OnError prints an error if err is not nil and exits the program.
func OnError(err error, text string) {
if err != nil {
Error("%s:, %s", text, err.Error())
Fatal("%s:, %s", text, err.Error())
}
}

// Error prints an error and exits the program.
func Error(format string, args ...interface{}) {
fmt.Fprintf(Stderr, color.RedString(format)+"\n", args...)
// Fatal prints an error and exits the program.
func Fatal(format string, args ...interface{}) {
fmt.Fprintf(os.Stderr, format+"\n", args...)
os.Exit(1)
}

// Info prints information.
func Info(format string, args ...interface{}) {
fmt.Fprintf(Stdout, color.GreenString(format)+"\n", args...)
fmt.Printf(format+"\n", args...)
}
25 changes: 0 additions & 25 deletions vendor/github.com/fatih/color/.github/workflows/go.yml

This file was deleted.

20 changes: 0 additions & 20 deletions vendor/github.com/fatih/color/LICENSE.md

This file was deleted.

182 changes: 0 additions & 182 deletions vendor/github.com/fatih/color/README.md

This file was deleted.

Loading

0 comments on commit bb65bee

Please sign in to comment.