Skip to content

Commit 2e373d4

Browse files
authored
Write variables to .bash_profile (#2545)
* Write variables to .bash_profile * Force write in .bash_profile Write in `.bash_profile` even if it does not exists (default cases for brand new macOS) * Update final message for environment variables
1 parent e3435eb commit 2e373d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

setup/native-script.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ def install(program_name, message, script, run_as_root = false, show_all_option
7777

7878
def install_environment_variable(name, value)
7979
ENV[name] = value
80-
81-
execute("echo \"export #{name}=#{value}\" >> ~/.profile", "Unable to set #{name}")
82-
80+
81+
execute("echo \"export #{name}=#{value}\" >> ~/.bash_profile", "Unable to set #{name}")
82+
8383
if File.exist?(File.expand_path("~/.zshrc"))
8484
execute("echo \"export #{name}=#{value}\" >> ~/.zprofile", "Unable to set #{name}")
8585
end
@@ -155,4 +155,5 @@ def install_environment_variable(name, value)
155155
end
156156
end
157157

158-
puts "The ANDROID_HOME and JAVA_HOME environment variables have been added to your .profile/.zprofile. Restart the terminal to use them."
158+
puts "The ANDROID_HOME and JAVA_HOME environment variables have been added to your .bash_profile/.zprofile"
159+
puts "Restart the terminal or run `source ~/.bash_profile` to use them."

0 commit comments

Comments
 (0)