Skip to content

Commit

Permalink
Fix pass no-color and verbose flags to crystal build (#517)
Browse files Browse the repository at this point in the history
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
  • Loading branch information
straight-shoota and Sija committed Sep 14, 2021
1 parent 635d36a commit c7a22e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/commands/build.cr
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ module Shards
"-o", File.join(Shards.bin_path, target.name),
target.main,
]
unless Shards.colors?
args << "--no-color"
end
if Shards::Log.level <= ::Log::Severity::Debug
args << "--verbose"
end
options.each { |option| args << option }
Log.debug { "crystal #{args.join(' ')}" }

Expand Down
6 changes: 1 addition & 5 deletions src/logger.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ require "colorize"
require "log"

module Shards
@@colors = true

def self.colors=(value)
@@colors = value
end
class_property? colors = true
end

Log.setup_from_env(
Expand Down

0 comments on commit c7a22e4

Please sign in to comment.