yonaskolb / Mint

A package manager that installs and runs executable Swift packages
MIT License
2.28k stars 122 forks source link

`mint run --silent` isn't totally silent when no version is specified in the Mintfile #142

Closed guillaumealgis closed 4 years ago

guillaumealgis commented 5 years ago

Example Mintfile:

realm/SwiftLint
❯ mint run --silent swiftlint swiftlint
🌱  MINTFILE: repository realm/SwiftLint has no defined version. Specify a version using <Repo>@<Commitish>.
Loading configuration from '.swiftlint.yml'
Linting Swift files at paths 
Linting 'Foobar.swift' (1/1)
Done linting! Found 0 violations, 0 serious in 1 files.

With the --silent option, I expected the lines

🌱 MINTFILE: repository foobar/Foobar has no defined version. Specify a version using Repo\>@<Commitish\.

to not appear on stdout.

guillaumealgis commented 5 years ago

Ok so after digging a bit more, it seems the message appears because it is not printed on stdout but on stderr.

So multiple solutions from here I think:

  1. Consider that having no version specified in the Mintfile is not actually an error (one might want to always use the latest version of a package), and print the message on stdout instead of stderr;
  2. Redirect both stdout and stderr to /dev/null when using the --silent flag. Potentially dangerous, but it would be a somewhat logical behavior given the name of the flag;
  3. Keep things as-is.
yonaskolb commented 4 years ago

Hi @guillaumealgis, I've gone ahead and removed the warning entirely on master

guillaumealgis commented 4 years ago

Great, thank you @yonaskolb !