Skip to content

Commit 920f36e

Browse files
authored
Merge pull request #131 from glebm/ver
extconf.rb: Always write VERSION if we have .git
2 parents 37e5173 + 6707d7e commit 920f36e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

ext/extconf.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@
3838
dir_config 'libsass'
3939

4040
libsass_version = Dir.chdir(libsass_dir) do
41-
if File.exist?('VERSION')
42-
File.read('VERSION').chomp
43-
elsif File.exist?('.git')
41+
if File.exist?('.git')
4442
ver = %x[git describe --abbrev=4 --dirty --always --tags].chomp
4543
File.write('VERSION', ver)
4644
ver
4745
end
46+
File.read('VERSION').chomp if File.exist?('VERSION')
4847
end
4948

5049
if libsass_version

sassc.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Gem::Specification.new do |spec|
4848
end
4949

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

0 commit comments

Comments
 (0)