Skip to content

Commit

Permalink
Merge branch 'main' into extract-env-writer
Browse files Browse the repository at this point in the history
* main:
  Inline util method only used in one place
  • Loading branch information
dhh committed Sep 16, 2023
2 parents b2d2a25 + 12a82a6 commit 85ce65a
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 @@ -79,18 +79,6 @@ def escape_shell_value(value)
.gsub(DOLLAR_SIGN_WITHOUT_SHELL_EXPANSION_REGEX, '\$')
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 85ce65a

Please sign in to comment.