Skip to content

Commit

Permalink
fixup! Add more customizations to Crystal::Config.description
Browse files Browse the repository at this point in the history
  • Loading branch information
will committed Mar 31, 2023
1 parent a0b4f18 commit 710f87c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/compiler/crystal/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ module Crystal
end

def self.description
formatted_sha = "[#{build_commit}] " if build_commit
formatted_date = "(#{date})" unless date.empty?
details = [version]
details << "[#{build_commit}]" if build_commit
details << "(#{date})" unless date.empty?

development_msg = "\n\nThe compiler was not built in release mode." unless release_mode?

<<-DOC
Crystal #{version} #{formatted_sha}#{formatted_date}
Crystal #{details.join(" ")}
LLVM: #{llvm_version}
Default target: #{self.host_target}
Release mode: #{self.release_mode}
Default target: #{self.host_target}#{development_msg}
DOC
end

Expand All @@ -43,7 +45,7 @@ module Crystal
end
end

def self.release_mode
def self.release_mode?
{{ flag?(:release) }}
end

Expand Down

0 comments on commit 710f87c

Please sign in to comment.