Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Improve `rad init` wording
✗ CI failure josibake committed 2 years ago
commit 487ca0a41f24f6c788fa10c2d1b5713e9549316a
parent 2701a0631bb388fa2b47b0ca9bde797547ac9a49
1 failed (1 total) View logs
2 files changed +8 -3
modified radicle-cli/examples/rad-init-no-git.md
@@ -3,7 +3,7 @@ it will fail:

``` (fail)
$ rad init
-
✗ Error: a Git repository was not found at the current path
+
✗ Error: a Git repository was not found at the given path
```

Ok so let's initialize one.
modified radicle-cli/src/commands/init.rs
@@ -196,7 +196,7 @@ pub fn init(options: Options, profile: &profile::Profile) -> anyhow::Result<()>
    let repo = match git::Repository::open(&path) {
        Ok(r) => r,
        Err(e) if radicle::git::ext::is_not_found_err(&e) => {
-
            anyhow::bail!("a Git repository was not found at the current path")
+
            anyhow::bail!("a Git repository was not found at the given path")
        }
        Err(e) => return Err(e.into()),
    };
@@ -320,8 +320,13 @@ pub fn init(options: Options, profile: &profile::Profile) -> anyhow::Result<()>
                term::format::dim("(RID)"),
                term::format::highlight(rid.urn())
            );
+
            let directory = if path == cwd {
+
                term::format::tertiary("this directory").to_string()
+
            } else {
+
                term::format::tertiary(path.display()).to_string()
+
            };
            term::info!(
-
                "You can show it any time by running {} from this directory.",
+
                "You can show it any time by running {} from {directory}.",
                term::format::command("rad .")
            );
            term::blank();