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

cp $file ~/path/ gives is not a directory #11683

Closed
crides opened this issue Jan 30, 2024 · 2 comments · Fixed by #11692
Closed

cp $file ~/path/ gives is not a directory #11683

crides opened this issue Jan 30, 2024 · 2 comments · Fixed by #11692
Labels
needs-triage An issue that hasn't had any proper look
Milestone

Comments

@crides
Copy link
Contributor

crides commented Jan 30, 2024

Describe the bug

I haven yet to do any testing, but it seems like after #11621, things like cp $stuff ~/path/ doesn't work anymore:

Error:   × is not a directory
   ╭─[entry #12:1:1]
 1 │ cargo b -rFextra;cp target/release/nu ~/.local/bin/
   ·                                       ──────┬──────
   ·                                             ╰── is not a directory
   ╰────

However, the error is gone if the trailing / is removed. It's also fine if ~ is not included. This is a bit surprising because ~ isn't even a glob

How to reproduce

shown above

Expected behavior

treat ~/path/ and ~/path the same for cp (and other FS commands if applicable)

Screenshots

No response

Configuration

key value
version 0.89.1
branch dev
commit_hash 45af3de
build_os macos-aarch64
build_target aarch64-apple-darwin
rust_version rustc 1.73.0 (cc66ad468 2023-10-03)
rust_channel 1.73.0-aarch64-apple-darwin
cargo_version cargo 1.73.0 (9c4383fb5 2023-08-26)
build_time 2024-01-29 10:28:03 -08:00
build_rust_channel release
allocator mimalloc
features default, extra, sqlite, trash, which, zip
installed_plugins from plist, to plist

Additional context

Last upstream I rebased to is 859f7b3dc add $.extra_usage to modules (#11649), and currently I'm on c371d1a53 (upstream/main) fix exit_code handling when running a scripts with ctrlc (#11466) to test that commit

@crides crides added the needs-triage An issue that hasn't had any proper look label Jan 30, 2024
@fdncred
Copy link
Collaborator

fdncred commented Jan 30, 2024

I noticed this with as well, that a trailing slash can confuse the operation. @WindSoilder can you take a look at this when you get a sec?

@WindSoilder
Copy link
Collaborator

Sure, I'll take a look today

@hustcer hustcer added this to the v0.90.0 milestone Feb 1, 2024
dmatos2012 pushed a commit to dmatos2012/nushell that referenced this issue Feb 20, 2024
# Description
Fixes: nushell#11683

# User-Facing Changes
NaN

# Tests + Formatting
~~I don't think we need to add a test, or else it'll copy some file to
user's directory, it seems bad.~~
Done.

# After Submitting
NaN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage An issue that hasn't had any proper look
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants