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 non-coloured tuistenv output #493

Merged
merged 6 commits into from Sep 18, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -14,6 +14,7 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/

- Transitively link static dependency's dynamic dependencies correctly https://github.com/tuist/tuist/pull/484 by @adamkhazi
- Prevent embedding static frameworks https://github.com/tuist/tuist/pull/490 by @kwridan
- Output losing its format when tuist is run through `tuistenv` https://github.com/tuist/tuist/pull/493 by @pepibumur

## 0.17.0

Expand Down
4 changes: 4 additions & 0 deletions Sources/TuistCore/Constants.swift
Expand Up @@ -8,4 +8,8 @@ public class Constants {
public static let version = "0.17.0"
public static let swiftVersion: String = "5.0"
public static let bundleName: String = "tuist.zip"

public class EnvironmentVariables {
public static let colouredOutput = "TUIST_COLOURED_OUTPUT"
}
}
11 changes: 4 additions & 7 deletions Sources/TuistCore/Linter/LintingIssue.swift
Expand Up @@ -48,16 +48,13 @@ public extension Array where Element == LintingIssue {
let warningIssues = filter { $0.severity == .warning }

if !warningIssues.isEmpty {
Printer.shared.print("The following issues have been found:", color: .yellow)
let message = warningIssues.map { " - \($0.description)" }.joined(separator: "\n")
Printer.shared.print(message)
let message = warningIssues.map { "- \($0.description)" }.joined(separator: "\n")
Printer.shared.print(warning: message)
}

if !errorIssues.isEmpty {
let prefix = !warningIssues.isEmpty ? "\n" : ""
Printer.shared.print("\(prefix)The following critical issues have been found:", output: .standardError)
let message = errorIssues.map { " - \($0.description)" }.joined(separator: "\n")
Printer.shared.print(message, output: .standardError)
let message = errorIssues.map { "- \($0.description)" }.joined(separator: "\n")
Printer.shared.print(errorMessage: message)

throw LintingError()
}
Expand Down