mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Merge pull request #13244 from stefanboca/sb/push-lmnqpuztqxmz
nix-profile{,-daemon}.fish: fix do not source twice
This commit is contained in:
commit
543cee1c92
2 changed files with 6 additions and 8 deletions
|
@ -1,17 +1,16 @@
|
||||||
# Only execute this file once per shell.
|
# Only execute this file once per shell.
|
||||||
if test -z "$HOME" || \
|
if test -z "$HOME" || test -n "$__ETC_PROFILE_NIX_SOURCED"
|
||||||
test -n "$__ETC_PROFILE_NIX_SOURCED"
|
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
set --global __ETC_PROFILE_NIX_SOURCED 1
|
set --global --export __ETC_PROFILE_NIX_SOURCED 1
|
||||||
|
|
||||||
# Local helpers
|
# Local helpers
|
||||||
|
|
||||||
function add_path --argument-names new_path
|
function add_path --argument-names new_path
|
||||||
if type -q fish_add_path
|
if type -q fish_add_path
|
||||||
# fish 3.2.0 or newer
|
# fish 3.2.0 or newer
|
||||||
fish_add_path --prepend --global $new_path
|
fish_add_path --prepend --global $new_path
|
||||||
else
|
else
|
||||||
# older versions of fish
|
# older versions of fish
|
||||||
if not contains $new_path $fish_user_paths
|
if not contains $new_path $fish_user_paths
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
# Only execute this file once per shell.
|
# Only execute this file once per shell.
|
||||||
if test -z "$HOME" || \
|
if test -z "$HOME" || test -n "$__ETC_PROFILE_NIX_SOURCED"
|
||||||
test -n "$__ETC_PROFILE_NIX_SOURCED"
|
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
set --global __ETC_PROFILE_NIX_SOURCED 1
|
set --global --export __ETC_PROFILE_NIX_SOURCED 1
|
||||||
|
|
||||||
# Local helpers
|
# Local helpers
|
||||||
|
|
||||||
function add_path --argument-names new_path
|
function add_path --argument-names new_path
|
||||||
if type -q fish_add_path
|
if type -q fish_add_path
|
||||||
# fish 3.2.0 or newer
|
# fish 3.2.0 or newer
|
||||||
fish_add_path --prepend --global $new_path
|
fish_add_path --prepend --global $new_path
|
||||||
else
|
else
|
||||||
# older versions of fish
|
# older versions of fish
|
||||||
if not contains $new_path $fish_user_paths
|
if not contains $new_path $fish_user_paths
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue