Skip to content

Commit

Permalink
chore(mk): clean ignored directories in make clean
Browse files Browse the repository at this point in the history
Signed-off-by: kilianpaquier <kilian@kilianpaquier.com>
  • Loading branch information
kilianpaquier committed Dec 21, 2024
1 parent d042bb9 commit 35aa2e3
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 13 deletions.
9 changes: 2 additions & 7 deletions internal/cobra/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ var (
Use: "upgrade",
Short: "Upgrade or install craft",
Run: func(cmd *cobra.Command, _ []string) {
ctx := cmd.Context()

options := []upgrade.RunOption{
upgrade.WithDestination(dest),
upgrade.WithHTTPClient(cleanhttp.DefaultClient()),
Expand All @@ -28,20 +26,17 @@ var (
upgrade.WithPrereleases(prereleases),
}

version, err := upgrade.Run(ctx, "craft", version, upgrade.GithubReleases("kilianpaquier", "craft"), options...)
version, err := upgrade.Run(cmd.Context(), "craft", version, upgrade.GithubReleases("kilianpaquier", "craft"), options...)
if err != nil {
switch {
case errors.Is(err, upgrade.ErrInvalidOptions):
logger.Fatal(err)
case errors.Is(err, upgrade.ErrNoNewVersion):
logger.Info(err)
return
case errors.Is(err, upgrade.ErrAlreadyInstalled):
logger.Infof("version '%s' is already installed", version)
return
default:
logger.Fatal(err)
}
return
}
logger.Infof("successfully installed version '%s'", version)
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/generate/_templates/scripts/craft.mk.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ clean:
{{- if hasKey .Languages "golang" }}
@go clean
{{- end }}
@git clean -Xf ./*
@git clean -dfX
2 changes: 1 addition & 1 deletion scripts/craft.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ generate:
.PHONY: clean
clean:
@go clean
@git clean -Xf ./*
@git clean -dfX
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ generate:
.PHONY: clean
clean:
@go clean
@git clean -Xf ./*
@git clean -dfX
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ generate:
.PHONY: clean
clean:
@go clean
@git clean -Xf ./*
@git clean -dfX
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ generate:
.PHONY: clean
clean:
@go clean
@git clean -Xf ./*
@git clean -dfX
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ generate:
.PHONY: clean
clean:
@go clean
@git clean -Xf ./*
@git clean -dfX

0 comments on commit 35aa2e3

Please sign in to comment.