Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extconf.rb: Always write VERSION if we have .git #131

Merged
merged 1 commit into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ext/extconf.rb
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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