mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 22:03:12 +00:00
config.fish: Clean up the . function a bit.
This commit is contained in:
parent
4d6a97d35c
commit
bcc4240d2b
1 changed files with 4 additions and 6 deletions
|
@ -142,12 +142,10 @@ end
|
||||||
# in UTF-8 (with non-ASCII characters).
|
# in UTF-8 (with non-ASCII characters).
|
||||||
__fish_set_locale
|
__fish_set_locale
|
||||||
|
|
||||||
# "." command for compatibility with old fish versions.
|
# "." alias for source; deprecated
|
||||||
function . --description 'Evaluate contents of file (deprecated, see "source")' --no-scope-shadowing
|
function . -d 'Evaluate a file (deprecated, use "source")' --no-scope-shadowing --wraps source
|
||||||
if test (count $argv) -eq 0
|
if [ (count $argv) -eq 0 ] && isatty 0
|
||||||
# Uses tty directly, as isatty depends on "."
|
echo "source: using source via '.' is deprecated, and stdin doesn't work."\n"Did you mean 'source' or './'?" >&2
|
||||||
and tty 0>&0 >/dev/null
|
|
||||||
echo "source: '.' command is deprecated, and doesn't work with STDIN anymore. Did you mean 'source' or './'?" >&2
|
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
source $argv
|
source $argv
|
||||||
|
|
Loading…
Reference in a new issue