Method: NA::Prompt.install_prompt_hook

Defined in:
lib/na/prompt.rb

.install_prompt_hook(shell) ⇒ Object



90
91
92
93
94
95
96
# File 'lib/na/prompt.rb', line 90

def install_prompt_hook(shell)
  file = prompt_file(shell)

  File.open(File.expand_path(file), 'a') { |f| f.puts prompt_hook(shell) }
  NA.notify("#{NA.theme[:success]}Added #{NA.theme[:filename]}#{shell}{x}#{NA.theme[:success]} prompt hook to #{NA.theme[:filename]}#{file}#{NA.theme[:success]}.")
  NA.notify("#{NA.theme[:warning]}You may need to close the current terminal and open a new one to enable the script.")
end