Skip to content

Commit

Permalink
Inline util method only used in one place
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Sep 16, 2023
1 parent 97cea89 commit 12a82a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
9 changes: 8 additions & 1 deletion lib/kamal/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ def version
end

def abbreviated_version
Kamal::Utils.abbreviate_version(version)
if version
# Don't abbreviate <sha>_uncommitted_<etc>
if version.include?("_")
version
else
version[0...7]
end
end
end

def minimum_version
Expand Down
12 changes: 0 additions & 12 deletions lib/kamal/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@ def escape_docker_env_file_value(value)
value.to_s.dump[1..-2].gsub(/\\"/, "\"")
end

# Abbreviate a git revhash for concise display
def abbreviate_version(version)
if version
# Don't abbreviate <sha>_uncommitted_<etc>
if version.include?("_")
version
else
version[0...7]
end
end
end

def uncommitted_changes
`git status --porcelain`.strip
end
Expand Down

0 comments on commit 12a82a6

Please sign in to comment.