Skip to content

Commit

Permalink
Merge pull request #5 from michelleN/update-dep
Browse files Browse the repository at this point in the history
Update dep, remove dead code, add testdata
  • Loading branch information
Michelle Noorali authored Dec 31, 2017
2 parents aaee9c7 + 46be8c2 commit dc077ee
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 55 deletions.
39 changes: 12 additions & 27 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
[[constraint]]
name = "github.com/Azure/draft"
source = "https://github.com/bacongobbler/draft"
branch = "pack-repo"

[[constraint]]
name = "github.com/Sirupsen/logrus"

[[constraint]]
name = "github.com/spf13/cobra"
20 changes: 1 addition & 19 deletions cmd/pack-repo/pack-repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,21 @@ import (
"os"
"strings"

log "github.com/Sirupsen/logrus"
"github.com/spf13/cobra"
)

const homeEnvVar = "DRAFT_HOME"

var (
flagDebug bool
globalUsage = `The Draft pack repository plugin.
var globalUsage = `The Draft pack repository plugin.
`
)

func newRootCmd(out io.Writer, in io.Reader) *cobra.Command {
cmd := &cobra.Command{
Use: "pack-repo",
Short: "the Draft pack repository plugin",
Long: globalUsage,
SilenceUsage: true,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if flagDebug {
log.SetLevel(log.DebugLevel)
}
},
}
p := cmd.PersistentFlags()
p.BoolVar(&flagDebug, "debug", false, "enable verbose output")

cmd.AddCommand(
newAddCmd(out),
Expand All @@ -52,13 +41,6 @@ func homePath() string {
return os.Getenv(homeEnvVar)
}

func debug(format string, args ...interface{}) {
if flagDebug {
format = fmt.Sprintf("[debug] %s\n", format)
fmt.Printf(format, args...)
}
}

func main() {
cmd := newRootCmd(os.Stdout, os.Stdin)
if err := cmd.Execute(); err != nil {
Expand Down
1 change: 1 addition & 0 deletions cmd/pack-repo/testdata/packrepo/packs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test pack repo
8 changes: 4 additions & 4 deletions version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

// Version contains the semver release and git commit.
type Version struct {
SemVer string `json:"semver"`
GitCommit string `json:"git-commit"`
SemVer string `json:"semver"`
GitCommit string `json:"git-commit"`
}

func (v *Version) String() string {
Expand Down Expand Up @@ -45,7 +45,7 @@ func getVersion() string {
// New returns the semver interpretation of the version.
func New() *Version {
return &Version{
SemVer: getVersion(),
GitCommit: GitCommit,
SemVer: getVersion(),
GitCommit: GitCommit,
}
}

0 comments on commit dc077ee

Please sign in to comment.