Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pass no-color and verbose flags to crystal build #517

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
]
if Shards.colors? == false
straight-shoota marked this conversation as resolved.
Show resolved Hide resolved
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