nushell/crates/nu-command/src/filesystem
David Matos ce378a68a6
Fix variables not allowed in ucp (#10304)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

# Description
Fixes #10300 , where using variables didnt work with `ucp` as it was
only expecting a `Expr::FilePath`.

Before: (from the issue)
```
❯ ucp -r $var $folder
Error:   × Missing file operand
   ╭─[entry #40:1:1]
 1 │ ucp -r $var $folder
   · ─┬─
   ·  ╰── Missing file operand
   ╰────
  help: Please provide source and destination paths
```
Now:
```
`ucp -r $var $folder`
# success
```

Also added the test to ensure its working:) . Oh, and I tweaked again
slightly the messages on two tests because now the whole `path` is
printed rather than `a`. Say:
```
#before
`cp a a` --> 'a' and 'a' are the same file 
# now
`cp a a` --> /home/current/location/a and /home/current/location/a are the same file
```
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- [X] `cargo fmt --all -- --check` to check standard code formatting
(`cargo fmt --all` applies these changes)
- [X] `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used`
to check that you're using the standard code style
- [X] `cargo test --workspace` to check that all tests pass (on Windows
make sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- [X] `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library
<!--

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-09-10 17:54:33 -05:00
..
cd_query.rs Fix typos by codespell (#7600) 2022-12-26 02:31:26 -05:00
cd.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
cp.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
glob.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
ls.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
mkdir.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
mod.rs use uutils/coreutils cp command in place of nushell's cp command (#10097) 2023-09-08 13:57:38 -05:00
mv.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
open.rs Document that open looks up from subcommands (#10255) 2023-09-06 19:26:53 +02:00
rm.rs Clean up trash support on Android (#10225) 2023-09-05 14:38:23 +02:00
save.rs Spanned Value step 1: span all value cases (#10042) 2023-08-25 08:48:05 +12:00
start.rs Apply nightly clippy lints (#9654) 2023-07-12 00:00:31 +02:00
touch.rs Document and critically review ShellError variants - Ep. 2 (#8326) 2023-03-06 11:31:07 +01:00
ucp.rs Fix variables not allowed in ucp (#10304) 2023-09-10 17:54:33 -05:00
util.rs Fix cp -u/mv -u when the dst doesn't exist (#9662) 2023-07-12 18:12:59 +02:00
watch.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00