mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00:00
Use physical $PWD
Yeah, the macOS tests fail because it's started in /private/var... with a $PWD of /var.... So resolve canonicalizes the path, which makes it no longer match $PWD. Simply use pwd -P
This commit is contained in:
parent
23a5e53247
commit
55c34cbb7c
1 changed files with 2 additions and 2 deletions
|
@ -113,11 +113,11 @@ path resolve bin//sh | string match -r -- 'bin/bash$'
|
|||
|
||||
# `path resolve` with nonexistent paths
|
||||
set -l path (path resolve foo/bar)
|
||||
string match -rq "^"(string escape --style=regex -- $PWD)'/' -- $path
|
||||
string match -rq "^"(pwd -P | string escape --style=regex)'/' -- $path
|
||||
and echo It matches pwd!
|
||||
or echo pwd is \'$PWD\' resolved path is \'$path\'
|
||||
# CHECK: It matches pwd!
|
||||
string replace -r "^"(string escape --style=regex -- $PWD)'/' "" -- $path
|
||||
string replace -r "^"(pwd -P | string escape --style=regex)'/' "" -- $path
|
||||
# CHECK: foo/bar
|
||||
|
||||
path resolve /banana//terracota/terracota/booooo/../pie
|
||||
|
|
Loading…
Reference in a new issue