refactor: rename updater package to update
This commit is contained in:
+2
-2
@@ -7,7 +7,7 @@ import (
|
||||
"slices"
|
||||
|
||||
"github.com/mathismqn/godeez/internal/buildinfo"
|
||||
"github.com/mathismqn/godeez/internal/updater"
|
||||
"github.com/mathismqn/godeez/internal/update"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/term"
|
||||
)
|
||||
@@ -19,7 +19,7 @@ func Execute(ctx context.Context) error {
|
||||
|
||||
var notice <-chan string
|
||||
if wantsUpdateNotice(root) {
|
||||
notice = updater.StartCheck(ctx)
|
||||
notice = update.StartCheck(ctx)
|
||||
}
|
||||
|
||||
err := root.ExecuteContext(ctx)
|
||||
|
||||
+4
-4
@@ -7,7 +7,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/mathismqn/godeez/internal/buildinfo"
|
||||
"github.com/mathismqn/godeez/internal/updater"
|
||||
"github.com/mathismqn/godeez/internal/update"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -39,11 +39,11 @@ func newUpdateCmd() *cobra.Command {
|
||||
}
|
||||
|
||||
func runUpdate(ctx context.Context, opts *updateOptions) error {
|
||||
if err := updater.CheckUpdatable(); err != nil {
|
||||
if err := update.CheckUpdatable(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
u := updater.New()
|
||||
u := update.New()
|
||||
u.Out = os.Stdout
|
||||
current := buildinfo.Version()
|
||||
|
||||
@@ -55,7 +55,7 @@ func runUpdate(ctx context.Context, opts *updateOptions) error {
|
||||
latest := release.Version()
|
||||
fmt.Printf("Current: %s\nLatest: %s\n", current, latest)
|
||||
|
||||
if !updater.IsNewer(current, latest) && !opts.force {
|
||||
if !update.IsNewer(current, latest) && !opts.force {
|
||||
fmt.Println("Already up to date.")
|
||||
|
||||
return nil
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package update
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package update
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package update
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package update
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package update
|
||||
|
||||
import (
|
||||
"strings"
|
||||
Reference in New Issue
Block a user