diff --git a/src/compiler/crystal/config.cr b/src/compiler/crystal/config.cr index 784f11ac4fef..5af9359c2b04 100644 --- a/src/compiler/crystal/config.cr +++ b/src/compiler/crystal/config.cr @@ -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