mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 04:41:14 -03:00
Define a common mktemp for tests
GNU and BSD `mktemp` handle options differently, and it's a useful utility for tests. As such, define a common `mktemp` function wrapper for the test suite. It might actually be nice to expand this for more flags and support it globally, but that may result in confusion for any users of BSD mktemp that expect to be running /bin/mktemp.
This commit is contained in:
@@ -82,11 +82,10 @@ echo ()[1]
|
||||
echo ()[d]
|
||||
|
||||
# Test tilde expansion
|
||||
# On OS X, we must pass an argument to mktemp,
|
||||
# and /tmp is symlinked to /private/tmp
|
||||
# On OS X, /tmp is symlinked to /private/tmp
|
||||
# $PWD is our best bet for resolving it
|
||||
set -l saved $PWD
|
||||
cd (mktemp -d /tmp/fish_tilde_XXXXXX)
|
||||
cd (mktemp -d)
|
||||
set tmpdir $PWD
|
||||
cd $saved
|
||||
mkdir $tmpdir/realhome
|
||||
|
||||
Reference in New Issue
Block a user