Skip to content

Commit c7a22e4

Browse files
Fix pass no-color and verbose flags to crystal build (#517)
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
1 parent 635d36a commit c7a22e4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/commands/build.cr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ module Shards
3434
"-o", File.join(Shards.bin_path, target.name),
3535
target.main,
3636
]
37+
unless Shards.colors?
38+
args << "--no-color"
39+
end
40+
if Shards::Log.level <= ::Log::Severity::Debug
41+
args << "--verbose"
42+
end
3743
options.each { |option| args << option }
3844
Log.debug { "crystal #{args.join(' ')}" }
3945

src/logger.cr

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ require "colorize"
22
require "log"
33

44
module Shards
5-
@@colors = true
6-
7-
def self.colors=(value)
8-
@@colors = value
9-
end
5+
class_property? colors = true
106
end
117

128
Log.setup_from_env(

0 commit comments

Comments
 (0)