From a839ab124a37c94796a9a162a3b604c3f8d2d546 Mon Sep 17 00:00:00 2001 From: Joel Longtine Date: Fri, 18 Feb 2022 16:26:51 -0700 Subject: [PATCH] Comment out unused code Signed-off-by: Joel Longtine --- cmd/dagger/cmd/common/track.go | 43 ++++++++++++++++------------------ cmd/dagger/cmd/up.go | 27 ++++++++++----------- 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/cmd/dagger/cmd/common/track.go b/cmd/dagger/cmd/common/track.go index 67bfe77a..cff3e745 100644 --- a/cmd/dagger/cmd/common/track.go +++ b/cmd/dagger/cmd/common/track.go @@ -2,11 +2,8 @@ package common import ( "context" - "crypto/sha256" - "fmt" "strings" - "github.com/go-git/go-git/v5" "github.com/spf13/cobra" "go.dagger.io/dagger/telemetry" ) @@ -32,27 +29,27 @@ func commandName(cmd *cobra.Command) string { } // hash returns the sha256 digest of the string -func hash(s string) string { - return fmt.Sprintf("%x", sha256.Sum256([]byte(s))) -} +// func hash(s string) string { +// return fmt.Sprintf("%x", sha256.Sum256([]byte(s))) +// } -// gitRepoURL returns the git repository remote, if any. -func gitRepoURL(path string) string { - repo, err := git.PlainOpenWithOptions(path, &git.PlainOpenOptions{ - DetectDotGit: true, - }) - if err != nil { - return "" - } +// // gitRepoURL returns the git repository remote, if any. +// func gitRepoURL(path string) string { +// repo, err := git.PlainOpenWithOptions(path, &git.PlainOpenOptions{ +// DetectDotGit: true, +// }) +// if err != nil { +// return "" +// } - origin, err := repo.Remote("origin") - if err != nil { - return "" - } +// origin, err := repo.Remote("origin") +// if err != nil { +// return "" +// } - if urls := origin.Config().URLs; len(urls) > 0 { - return urls[0] - } +// if urls := origin.Config().URLs; len(urls) > 0 { +// return urls[0] +// } - return "" -} +// return "" +// } diff --git a/cmd/dagger/cmd/up.go b/cmd/dagger/cmd/up.go index d62c1108..8d8187a8 100644 --- a/cmd/dagger/cmd/up.go +++ b/cmd/dagger/cmd/up.go @@ -8,7 +8,6 @@ import ( "go.dagger.io/dagger/client" "go.dagger.io/dagger/cmd/dagger/cmd/common" "go.dagger.io/dagger/cmd/dagger/logger" - "go.dagger.io/dagger/mod" "go.dagger.io/dagger/plan" "go.dagger.io/dagger/solver" "golang.org/x/term" @@ -61,20 +60,20 @@ var upCmd = &cobra.Command{ }, } -func checkUniverseVersion(ctx context.Context, projectPath string) bool { - lg := log.Ctx(ctx) +// func checkUniverseVersion(ctx context.Context, projectPath string) bool { +// lg := log.Ctx(ctx) - isLatest, err := mod.IsUniverseLatest(ctx, projectPath) - if err != nil { - lg.Debug().Err(err).Msg("failed to check universe version") - return false - } - if !isLatest { - return true - } - lg.Debug().Msg("universe is up to date") - return false -} +// isLatest, err := mod.IsUniverseLatest(ctx, projectPath) +// if err != nil { +// lg.Debug().Err(err).Msg("failed to check universe version") +// return false +// } +// if !isLatest { +// return true +// } +// lg.Debug().Msg("universe is up to date") +// return false +// } func europaUp(ctx context.Context, cl *client.Client, args ...string) error { lg := log.Ctx(ctx)