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

nupm install --force tries to remove non-existing destinations #61

Closed
amtoine opened this issue Jan 28, 2024 · 0 comments · Fixed by #62
Closed

nupm install --force tries to remove non-existing destinations #61

amtoine opened this issue Jan 28, 2024 · 0 comments · Fixed by #62
Labels
bug Something isn't working

Comments

@amtoine
Copy link
Member

amtoine commented Jan 28, 2024

related to

Description

Steps to reproduce

  • checkout the latest main of Nupm, i.e. 66e2eaa
  • bring the module into scope
use ./nupm/
  • try to install Nupm itself with a blank NUPM_HOME and the --force option to make sure whatever was there is overwritten
NUPM_HOME=/tmp/nupm nupm install --force --path . --no-confirm
  • see the following error
2024-01-28T10:05:44.110|INF|installing package nupm
Error:   × Directory not found
    ╭─[/home/amtoine/documents/repos/github.com/amtoine/nushell-nupm/nupm/install.nu:89:1]
 89 │             if $force {
 90 │                 rm --recursive --force $destination
    ·                                        ──────┬─────
    ·                                              ╰── Directory not found
 91 │             }
    ╰────

Version

key value
version 0.89.1
branch nightly
commit_hash 859f7b3dc7f7499efe10310910b004772e7c0bee
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.73.0 (cc66ad468 2023-10-03)
rust_channel 1.73.0-x86_64-unknown-linux-gnu
cargo_version cargo 1.73.0 (9c4383fb5 2023-08-26)
build_time 2024-01-28 01:49:46 +00:00
build_rust_channel release
allocator mimalloc
features default, sqlite, static-link-openssl, trash, which, zip
installed_plugins clipboard copy, clipboard paste, gstat, nu_plugin_explore
@amtoine amtoine added the bug Something isn't working label Jan 28, 2024
kubouch pushed a commit that referenced this issue Jan 28, 2024
- should close #61 

## Description
`nupm install --force` should not try to `rm` the content of
`$destination` if it does not exist.
this PR adds a check for that and a test to the CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant