From 00f209e16ed0698f10c8b8d03204f3d7e9850ce8 Mon Sep 17 00:00:00 2001 From: Niklas Higi Date: Sat, 5 Feb 2022 16:29:09 +0100 Subject: [PATCH] Recommend interactive usage of `fish_add_path` Since the `fish_add_path` command modifies a universal Fish variable (which is automatically persisted to a file) it's unnecessary to run it again every time a new shell is opened. --- Library/Homebrew/test/utils/shell_spec.rb | 2 +- Library/Homebrew/utils/shell.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/test/utils/shell_spec.rb b/Library/Homebrew/test/utils/shell_spec.rb index e0edf6fd28..02f795bee3 100644 --- a/Library/Homebrew/test/utils/shell_spec.rb +++ b/Library/Homebrew/test/utils/shell_spec.rb @@ -98,7 +98,7 @@ describe Utils::Shell do ENV["SHELL"] = "/usr/local/bin/fish" ENV["fish_user_paths"] = "/some/path" expect(described_class.prepend_path_in_profile(path)) - .to eq("echo 'fish_add_path #{path}' >> #{shell_profile}") + .to eq("fish_add_path #{path}") end end end diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index edcbd26da4..5547e00b05 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -78,7 +78,7 @@ module Utils when :csh, :tcsh "echo 'setenv PATH #{csh_quote(path)}:$PATH' >> #{profile}" when :fish - "echo 'fish_add_path #{sh_quote(path)}' >> #{profile}" + "fish_add_path #{sh_quote(path)}" end end