Skip to content

Commit

Permalink
Add - in the middle
Browse files Browse the repository at this point in the history
  • Loading branch information
showwin committed Aug 14, 2024
1 parent a02a160 commit 8e33e86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/degica_datadog/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ def service
end

def version
@version || (ENV.fetch("PLATFORM", "") + ENV.fetch("_GIT_REVISION", "unknown"))
return @version if @version

platform = ENV.fetch("PLATFORM", "")
git_revision = ENV.fetch("_GIT_REVISION", "unknown")
platform.empty? ? git_revision : "#{platform}-#{git_revision}"
end

def environment
Expand Down
2 changes: 1 addition & 1 deletion spec/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
end

it "sets version correctly" do
expect(described_class.version).to eq("#{platform}#{version}")
expect(described_class.version).to eq("#{platform}-#{version}")
end
end
end
Expand Down

0 comments on commit 8e33e86

Please sign in to comment.