Comment out unused code

Signed-off-by: Joel Longtine <joel@dagger.io>
This commit is contained in:
Joel Longtine 2022-02-18 16:26:51 -07:00
parent cdde074d09
commit a839ab124a
2 changed files with 33 additions and 37 deletions

View File

@ -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 ""
// }

View File

@ -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)