We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 98aa3e4 + 0e3c215 commit 637a9a3Copy full SHA for 637a9a3
crates/templates/src/manager.rs
@@ -1,4 +1,4 @@
1
-use std::path::Path;
+use std::{io::IsTerminal, path::Path};
2
3
use anyhow::Context;
4
@@ -90,10 +90,11 @@ pub struct ListResults {
90
}
91
92
impl ListResults {
93
- /// Returns true if no templates were found or skipped indicating that
94
- /// templates may not be installed.
+ /// Returns true if no templates were found or skipped, and the UI should prompt to
+ /// install templates. This is specifically for interactive use and returns false
95
+ /// if not connected to a terminal.
96
pub fn needs_install(&self) -> bool {
- self.templates.is_empty() && self.skipped.is_empty()
97
+ self.templates.is_empty() && self.skipped.is_empty() && std::io::stderr().is_terminal()
98
99
100
0 commit comments