summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorCyborus <cyborus@noreply.codeberg.org>2023-12-13 02:06:00 +0100
committerCyborus <cyborus@noreply.codeberg.org>2023-12-13 02:06:00 +0100
commit98e3cceff8170faf0b1f3a8e24b84d84714876d7 (patch)
tree92db800978e190cd63334945d2f44215cb5f49c0 /src/main.rs
parentMerge pull request 'add basic issue commands' (#7) from issues into main (diff)
parentformat (diff)
downloadforgejo-cli-98e3cceff8170faf0b1f3a8e24b84d84714876d7.tar.xz
forgejo-cli-98e3cceff8170faf0b1f3a8e24b84d84714876d7.zip
Merge pull request 'add ci' (#8) from ci into main
Reviewed-on: https://codeberg.org/Cyborus/forgejo-cli/pulls/8
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 856f958..c7674d0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -67,7 +67,7 @@ async fn readline(msg: &str) -> eyre::Result<String> {
async fn editor(contents: &mut String, ext: Option<&str>) -> eyre::Result<()> {
let editor = std::env::var_os("EDITOR").ok_or_else(|| eyre!("unable to locate editor"))?;
-
+
let (mut file, path) = tempfile(ext).await?;
file.write_all(contents.as_bytes()).await?;
drop(file);
@@ -88,7 +88,8 @@ async fn editor(contents: &mut String, ext: Option<&str>) -> eyre::Result<()> {
eprint!(" \r");
Ok(())
- })().await;
+ })()
+ .await;
tokio::fs::remove_file(path).await?;
res?;