Skip to content

Commit

Permalink
Allow head to compile in Crystal 0.24 and 0.25
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardiff authored and ysbaddaden committed Jun 4, 2018
1 parent a8fd1a6 commit 3d3a24c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/package.cr
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ module Shards
destination = File.join(Shards.bin_path, name)

if File.exists?(destination)
next if File.stat(destination).ino == File.stat(source).ino
{% if File.class.has_method?(:same?) %}
# Since Crystal 0.25.0
next if File.same?(destination, source)
{% else %}
# Up to Crystal 0.24.2
next if File.stat(destination).ino == File.stat(source).ino
{% end %}
File.delete(destination)
end

Expand Down

0 comments on commit 3d3a24c

Please sign in to comment.