mirror of
https://github.com/zhaofengli/attic.git
synced 2024-12-14 11:57:30 +00:00
client/push: Suggest --stdin if stdin isn't a terminal
This commit is contained in:
parent
8f215042db
commit
014fb92a9e
1 changed files with 11 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
use std::io::IsTerminal;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -57,6 +58,16 @@ struct PushContext {
|
|||
|
||||
impl PushContext {
|
||||
async fn push_static(self, paths: Vec<PathBuf>) -> Result<()> {
|
||||
if paths.is_empty() {
|
||||
eprintln!("🤷 Nothing specified.");
|
||||
if !std::io::stdin().is_terminal() {
|
||||
eprintln!(
|
||||
"Hint: Pass --stdin to read the list of store paths from standard input."
|
||||
);
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let roots = paths
|
||||
.into_iter()
|
||||
.map(|p| self.store.follow_store_path(p))
|
||||
|
|
Loading…
Reference in a new issue