Skip to content

Commit

Permalink
Update diff cmd messaging slightly and fix lint (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSGK authored May 3, 2024
1 parent d5a8846 commit cdf6191
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions cmd/lekko/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,6 @@ func isSame(ctx context.Context, existing map[string]map[string]*featurev1beta1.
if err != nil {
return false, err
}
if err != nil {
return false, err
}
b, err := os.ReadFile("go.mod")
if err != nil {
return false, err
Expand Down Expand Up @@ -309,6 +306,7 @@ func diffCmd() *cobra.Command {
if err != nil {
return err
}
// TODO: There might be some way to only need to have one clone of the repository
isHeadSame, err := isSame(ctx, existing, registry, headPath)
if err != nil {
return err
Expand All @@ -318,15 +316,16 @@ func diffCmd() *cobra.Command {
return err
}
if !isHeadSame && !isBaseSame {
fmt.Print("Create a PR to fix Base first\n")
fmt.Println("Update the base branch to match Lekko")
os.Exit(1)
} else if !isHeadSame && isBaseSame {
fmt.Print("Push Head changes to Lekko before Merge\n")
fmt.Println("Sync changes from the current branch to Lekko")
os.Exit(2)
} else if isHeadSame && !isBaseSame {
fmt.Print("Merging will make Base = Lekko\n")
fmt.Println("Merging the current branch will update the base branch to match Lekko")
return nil
} else if isHeadSame && isBaseSame {
fmt.Println("The current branch does not contain any changes to Lekko")
return nil
}
return nil
Expand Down

0 comments on commit cdf6191

Please sign in to comment.