Skip to content

Commit

Permalink
Merge pull request #131 from glebm/ver
Browse files Browse the repository at this point in the history
extconf.rb: Always write VERSION if we have .git
  • Loading branch information
bolandrm committed Jun 18, 2019
2 parents 37e5173 + 6707d7e commit 920f36e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions ext/extconf.rb
Expand Up @@ -38,13 +38,12 @@
dir_config 'libsass'

libsass_version = Dir.chdir(libsass_dir) do
if File.exist?('VERSION')
File.read('VERSION').chomp
elsif File.exist?('.git')
if File.exist?('.git')
ver = %x[git describe --abbrev=4 --dirty --always --tags].chomp
File.write('VERSION', ver)
ver
end
File.read('VERSION').chomp if File.exist?('VERSION')
end

if libsass_version
Expand Down
2 changes: 1 addition & 1 deletion sassc.gemspec
Expand Up @@ -48,7 +48,7 @@ Gem::Specification.new do |spec|
end

# Write a VERSION file for non-binary gems (for `SassC::Native.version`).
if !File.exist?(File.join(libsass_dir, 'VERSION'))
if File.exist?(File.join(libsass_dir, '.git'))
libsass_version = Dir.chdir(libsass_dir) do
%x[git describe --abbrev=4 --dirty --always --tags].chomp
end
Expand Down

0 comments on commit 920f36e

Please sign in to comment.