Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
Improve `rad init` wording
Merged did:key:z6MkoVzH...CBrJ opened 2 years ago

Opening mostly to get familiar with radicle and get some hands on experience. The first commit removes a hardcoded value that was making the tests fail for me and the second improves the rad init cli text.

3 files changed +13 -8 18fc41c5 ce1e1f71
modified radicle-cli/examples/rad-inbox.md
@@ -21,7 +21,7 @@ $ rad inbox --sort-by id
╭──────────────────────────────────────────────────────────────────────╮
│ heartwood                                                            │
├──────────────────────────────────────────────────────────────────────┤
-
│ 001   ●   58fff44    No license file    issue    open      bob   now │
+
│ 001   ●   [ ... ]    No license file    issue    open      bob   now │
│ 002   ●   bob/copy   Change copyright   branch   created   bob   now │
╰──────────────────────────────────────────────────────────────────────╯
```
@@ -31,12 +31,12 @@ $ rad inbox --all --sort-by id
╭────────────────────────────────────────────────────────────────╮
│ radicle-git                                                    │
├────────────────────────────────────────────────────────────────┤
-
│ 003   ●   4dd5843   Copyright fixes   patch   open   bob   now │
+
│ 003   ●   [ ... ]   Copyright fixes   patch   open   bob   now │
╰────────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────────────────────────────╮
│ heartwood                                                            │
├──────────────────────────────────────────────────────────────────────┤
-
│ 001   ●   58fff44    No license file    issue    open      bob   now │
+
│ 001   ●   [ ... ]    No license file    issue    open      bob   now │
│ 002   ●   bob/copy   Change copyright   branch   created   bob   now │
╰──────────────────────────────────────────────────────────────────────╯
```
@@ -67,7 +67,7 @@ $ rad inbox list --sort-by id
╭──────────────────────────────────────────────────────────────────────╮
│ heartwood                                                            │
├──────────────────────────────────────────────────────────────────────┤
-
│ 001   ●   58fff44    No license file    issue    open      bob   now │
+
│ 001   ●   [ ... ]    No license file    issue    open      bob   now │
│ 002       bob/copy   Change copyright   branch   created   bob   now │
╰──────────────────────────────────────────────────────────────────────╯
```
@@ -93,7 +93,7 @@ $ rad inbox --all
╭────────────────────────────────────────────────────────────────╮
│ radicle-git                                                    │
├────────────────────────────────────────────────────────────────┤
-
│ 003   ●   4dd5843   Copyright fixes   patch   open   bob   now │
+
│ 003   ●   [ ... ]   Copyright fixes   patch   open   bob   now │
╰────────────────────────────────────────────────────────────────╯
```

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();