Skip to content

Commit

Permalink
Merge pull request #178 from evolvingweb/version-bug-fix
Browse files Browse the repository at this point in the history
Fix for version bug in Docker image.
  • Loading branch information
kirk-brown-ew authored Sep 8, 2023
2 parents 340c0b6 + b8c98f6 commit 1dea3c6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/sitediff/cli.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'bundler'
require 'thor'
require 'sitediff'
require 'sitediff/api'
Expand Down Expand Up @@ -40,7 +41,15 @@ def self.check_unknown_options?(_config)
##
# Show version information.
def version
gemspec = SiteDiff.gemspec
filename = '../../sitediff.gemspec'
unless File.exist?(File.expand_path(filename, __dir__))
if File.exist?(File.expand_path('/sitediff/sitediff.gemspec', __dir__))
filename = '/sitediff/sitediff.gemspec'
end
end

gemspec = Bundler.load_gemspec(File.expand_path(filename, __dir__))

output = []
output.push("Sitediff CLI #{gemspec.version}")
if options[:verbose]
Expand Down

0 comments on commit 1dea3c6

Please sign in to comment.