A. Taha Baki
d25be66929
check existance w/o traversing symlinks ( #10872 )
...
# Description
Currently `path exists` checks the file/folder's existence by traversing
symlinks. I've added a `-n` switch/flag that disables symlink
traversing, similar to what `path expand -n` does.
## The Long Story (for those interested)
Hello! 👋 While working on one of my scripts, I discovered that the `path
exists` command was traversing symlinks. This meant that even if the
file existed, it would fail if the pointed location didn't exist. To
address this, I've introduced a new `-n` flag, which I borrowed from the
`path expand` command. This addition should make the behavior more
consistent within the *path commands universe*.
## But, is it any useful?
```nushell
let compat = /run/media/userX/DriveX/steam/steamapps/compatdata
if "symlink" == ($compat | path expand -n | path type) {}
# to this
if ($compat | path exists -n) {}
```
# User-Facing Changes
Users, will not efect. Unless they use the mentioned `-n` flag/switch.
2024-01-14 07:33:33 +08:00
..
2023-12-07 05:46:37 +08:00
2023-08-24 07:08:58 -05:00
2023-08-04 06:06:00 +12:00
2023-07-17 18:43:51 +02:00
2023-11-29 23:21:34 +01:00
2023-11-29 23:21:34 +01:00
2023-12-28 15:26:34 +08:00
2024-01-14 07:33:33 +08:00
2023-10-19 22:04:33 +02:00
2022-11-22 16:58:11 -08:00
2023-11-17 06:49:19 +08:00
2023-11-29 23:21:34 +01:00
2023-10-27 19:16:17 +02:00
2023-11-29 23:21:34 +01:00
2023-10-05 18:43:58 +02:00
2023-12-04 20:56:46 +02:00
2023-05-17 18:55:26 -05:00
2023-05-17 18:55:26 -05:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-11-16 15:14:45 -06:00
2023-11-29 23:21:34 +01:00
2024-01-03 07:22:43 -06:00
2023-09-25 08:00:59 -05:00
2023-09-25 08:00:59 -05:00
2023-04-07 14:09:55 -07:00
2023-11-17 07:30:57 +08:00
2023-10-24 12:48:05 -05:00
2024-01-05 11:40:56 +08:00
2023-11-29 23:21:34 +01:00
2023-10-19 22:08:09 +02:00
2023-12-15 14:53:19 +08:00
2023-11-09 13:51:46 +01:00
2023-07-06 08:31:31 -07:00
2023-09-13 06:35:01 +12:00
2023-04-07 14:09:55 -07:00
2023-11-03 10:09:33 -05:00
2023-04-07 14:09:55 -07:00
2023-12-28 15:43:20 +08:00
2023-05-17 18:55:26 -05:00
2023-05-17 18:55:26 -05:00
2023-06-10 16:57:26 -05:00
2023-08-23 16:03:26 -05:00
2023-11-29 23:21:34 +01:00
2023-09-13 06:35:01 +12:00
2023-08-02 10:57:58 -05:00
2023-10-19 09:30:34 -05:00
2023-12-02 11:01:08 -06:00
2023-10-10 03:31:15 +13:00
2023-11-29 23:21:34 +01:00
2023-07-21 17:32:37 +02:00
2023-08-31 23:10:29 +02:00
2023-11-29 23:21:34 +01:00
2023-12-09 15:22:45 -06:00
2023-05-22 13:54:04 -05:00
2023-07-23 20:14:51 +02:00
2023-09-13 23:53:55 +02:00
2023-09-15 15:46:25 -05:00
2023-05-17 18:55:26 -05:00
2023-08-23 16:03:26 -05:00
2023-08-25 08:48:05 +12:00
2023-09-14 10:18:29 +12:00
2023-08-09 14:12:58 +02:00
2023-09-13 06:35:01 +12:00
2024-01-11 17:19:48 +02:00
2023-10-25 06:30:45 +08:00
2023-11-29 23:21:34 +01:00
2023-07-21 17:32:37 +02:00
2023-11-17 19:30:53 -06:00
2023-12-16 09:07:08 -06:00
2023-07-21 17:32:37 +02:00
2023-10-19 22:08:09 +02:00
2023-10-13 13:45:36 -05:00
2023-07-21 17:32:37 +02:00
2023-09-16 21:49:10 +02:00
2023-03-15 18:54:55 +13:00
2023-07-17 18:43:51 +02:00
2023-07-21 17:32:37 +02:00
2023-12-23 20:01:20 +01:00
2023-10-08 13:12:46 +02:00
2023-11-01 21:25:35 +01:00
2023-11-29 23:21:34 +01:00
2023-09-28 18:49:42 +02:00
2023-07-17 18:43:51 +02:00
2024-01-02 21:27:03 +08:00
2023-07-21 17:32:37 +02:00
2023-07-17 18:43:51 +02:00
2024-01-05 11:40:56 +08:00
2023-12-24 23:29:23 +08:00
2023-11-29 23:21:34 +01:00
2023-04-28 13:25:44 +02:00
2023-04-28 13:25:44 +02:00
2023-04-28 13:25:44 +02:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-08-31 23:10:29 +02:00
2023-11-29 23:21:34 +01:00
2023-10-19 22:08:09 +02:00
2023-09-01 00:08:27 +02:00
2023-11-16 05:28:54 -06:00
2023-11-21 20:48:39 -06:00
2022-12-22 16:38:07 -08:00
2023-07-21 17:32:37 +02:00
2023-04-28 13:25:44 +02:00
2023-07-17 18:43:51 +02:00
2024-01-12 12:02:55 -06:00
2023-12-19 08:58:45 -06:00
2023-10-30 07:59:48 -05:00
2023-11-29 23:21:34 +01:00
2023-11-29 23:21:34 +01:00
2023-12-09 15:22:45 -06:00
2023-12-09 15:22:45 -06:00
2023-12-05 11:38:45 +01:00
2023-08-29 13:18:52 -07:00
2023-07-20 19:10:53 -05:00
2023-09-13 06:35:01 +12:00
2023-07-17 18:43:51 +02:00
2023-11-29 23:21:34 +01:00
2023-07-21 17:32:37 +02:00