wepub 0.4.0

CLI to publish browser extensions to Chrome Web Store, Firefox Add-ons, and Edge Add-ons
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::path::Path;

use anyhow::Result;
use tokio::io::AsyncReadExt;

pub(crate) async fn read_text_input(path: &Path) -> Result<String> {
    if path.as_os_str() == "-" {
        let mut buf = String::new();
        tokio::io::stdin().read_to_string(&mut buf).await?;
        Ok(buf)
    } else {
        Ok(tokio::fs::read_to_string(path).await?)
    }
}