Skip to content

Commit

Permalink
Use read_file macro in Crystal::Config.version
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Nov 13, 2018
1 parent 2d4e955 commit 79f2924
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/compiler/crystal/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ module Crystal
end

def self.version
{% if flag?(:windows) %}
{{ `type #{__DIR__}/../../../VERSION`.stringify.chomp }}
{% else %}
{{ `cat #{__DIR__}/../../../VERSION`.stringify.chomp }}
{% begin %}
{% version = read_file("#{__DIR__}/../../../VERSION") %}
{{ version ? version.chomp : nil }}
{% end %}
end

Expand Down

0 comments on commit 79f2924

Please sign in to comment.