mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
Fix recording to a pipe
This commit is contained in:
@@ -120,16 +120,16 @@ impl Cli {
|
|||||||
let path = Path::new(&self.filename);
|
let path = Path::new(&self.filename);
|
||||||
|
|
||||||
if path.exists() {
|
if path.exists() {
|
||||||
if !append && !overwrite {
|
|
||||||
bail!("file exists, use --overwrite or --append");
|
|
||||||
}
|
|
||||||
|
|
||||||
let metadata = fs::metadata(path)?;
|
let metadata = fs::metadata(path)?;
|
||||||
|
|
||||||
if metadata.len() == 0 {
|
if metadata.len() == 0 {
|
||||||
overwrite = true;
|
overwrite = true;
|
||||||
append = false;
|
append = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !append && !overwrite {
|
||||||
|
bail!("file exists, use --overwrite or --append");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
append = false;
|
append = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user