Skip to content

Commit

Permalink
infer podspec version from git
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-makarov committed Aug 25, 2019
1 parent 352b86b commit 42c32ce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Logging.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
def self.infer_version_from_git
return nil unless Dir.exist?('.git')

`git tag --list '*.*.*' --sort=committerdate`.split.select do |tag|
Version.correct?(tag)
end.last
end

Pod::Spec.new do |spec|
spec.name = "Logging"
spec.version = "0.0.1"
spec.version = infer_version_from_git || (raise Informative, 'Could not infer `Logging` version from git')
spec.summary = "A Logging API package for Swift 5."

spec.description = <<-DESC
Expand Down

0 comments on commit 42c32ce

Please sign in to comment.