Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot remove a repo when inside of it #179

Closed
amtoine opened this issue Feb 6, 2024 · 0 comments · Fixed by #180
Closed

cannot remove a repo when inside of it #179

amtoine opened this issue Feb 6, 2024 · 0 comments · Fixed by #180
Labels
bug Something isn't working as expected core Related to the main `nu-git-manager` module

Comments

@amtoine
Copy link
Owner

amtoine commented Feb 6, 2024

Describe the bug

as per title

How to reproduce

tk run --clean {
    gm update-cache

    gm clone --depth 1 https://github.com/amtoine/nu-git-manager
    let repo = gm list --full-path | find nu-git-manager | get 0
    cd $repo
    gm remove --no-confirm nu-git-manager
}

will give

Error:   × Cannot remove any parent directory
     ╭─[/home/amtoine/.local/share/nupm/modules/nu-git-manager/mod.nu:433:1]
 433 │
 434 │     rm --recursive --force --verbose $repo_to_remove
     ·                                      ───────┬───────
     ·                                             ╰── cannot remove any parent directory
 435 │
     ╰────

Expected behavior

i expected either the repo to be removed or at least a nice error

Configuration

key value
version 0.89.0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.73.0 (cc66ad468 2023-10-03)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.73.0 (9c4383fb5 2023-08-26)
build_time 2024-01-11 18:20:14 +01:00
build_rust_channel release
allocator mimalloc
features default, sqlite, trash, which, zip
installed_plugins clipboard copy, clipboard paste, gstat, nu_plugin_explore, query git

Additional context

No response

@amtoine amtoine added bug Something isn't working as expected core Related to the main `nu-git-manager` module labels Feb 6, 2024
amtoine added a commit that referenced this issue Feb 6, 2024
should close #179 

the new error is
```
2024-02-06T17:22:23.959|ERR|cannot remove the repo because you are inside it
```
when trying to remove a repo the user is currently in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected core Related to the main `nu-git-manager` module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant