Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Don't strip initial message from editor
Alexis Sellier committed 3 years ago
commit 6c1e2d0ddd36316d1dc2ea331db92c4fdf76e4a1
parent 63fc06c81744ce28183c61b6978892711fbdcc6a
2 files changed +2 -4
modified radicle-cli/src/commands/patch/create.rs
@@ -40,7 +40,7 @@ pub fn handle_patch_message(
    let (title, description) = (title.trim(), description.trim());

    if title.is_empty() {
-
        anyhow::bail!("a title must be given");
+
        anyhow::bail!("a patch title must be provided");
    }

    Ok((title.to_string(), description.to_owned()))
modified radicle-term/src/editor.rs
@@ -69,12 +69,10 @@ impl Editor {
        process::Command::new(cmd).arg(&self.path).spawn()?.wait()?;

        let text = fs::read_to_string(&self.path)?;
-
        let text = text.strip_prefix(&initial).unwrap_or(&text);
-

        if text.trim().is_empty() {
            return Ok(None);
        }
-
        Ok(Some(text.to_owned()))
+
        Ok(Some(text))
    }
}