Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/git error hint #712

Merged
merged 3 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
.vscode
node_modules
coverage
.aider*
.env
9 changes: 9 additions & 0 deletions spec/installer/repository_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ describe "Repository" do

0.1.0
0.2.0

Hint: Run mint tool clean; mint tool clean --package-cache to reset local
state, and then try again.
MESSAGE

begin
Expand Down Expand Up @@ -98,6 +101,9 @@ describe "Repository" do
The error I got from the git command is this:

cloned

Hint: Run mint tool clean; mint tool clean --package-cache to reset local
state, and then try again.
MESSAGE

begin
Expand All @@ -119,6 +125,9 @@ describe "Repository" do
The error I got from the git command is this:

fetched

Hint: Run mint tool clean; mint tool clean --package-cache to reset local
state, and then try again.
MESSAGE

begin
Expand Down
18 changes: 18 additions & 0 deletions src/installer/repository.cr
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ module Mint
block do
bold error.to_s.strip
end

block do
text "Hint: Run "
bold "mint tool clean; mint tool clean --package-cache"
text " to reset local state, and then try again."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extraneous space here.

ditto elsewhere

end
end unless status.success?

output
Expand Down Expand Up @@ -138,6 +144,12 @@ module Mint
block do
bold error.to_s.strip
end

block do
text "Hint: Run "
bold "mint tool clean; mint tool clean --package-cache"
text " to reset local state, and then try again."
end
end unless status.success?

terminal.puts " #{CHECKMARK} Updated #{id}"
Expand All @@ -158,6 +170,12 @@ module Mint
block do
bold error.to_s.strip
end

block do
text "Hint: Run "
bold "mint tool clean; mint tool clean --package-cache"
text " to reset local state, and then try again."
end
end unless status.success?

terminal.puts " #{CHECKMARK} Cloned #{id}"
Expand Down