Update welcome.rb

add zsh timezone logic.
This commit is contained in:
deepend-tildeclub authored and GitHub committed 2024-08-09 15:27:15 -06:00
1 parent 7e0f140f50
commit f0cc491ed9
1 file changed
+9 -3
+9 -3
View File
@@ -116,9 +116,15 @@ puts " great, let's set up your timezone!"
puts
tz = %x{tzselect}.chomp
puts
puts " you selected #{tz}, adding this to your ~/.profile now"
puts " it might not take effect until you log out and back in"
open("#{Dir.home}/.profile", "a") { |f| f.puts "export TZ='#{tz}'" }
puts " you selected #{tz}, adding this to your profile now"
if File.basename(user_shell) == "zsh"
open("#{Dir.home}/.zshrc", "a") { |f| f.puts "export TZ='#{tz}'" }
puts " Timezone set in your .zshrc file for ZSH."
else
open("#{Dir.home}/.profile", "a") { |f| f.puts "export TZ='#{tz}'" }
puts " Timezone set in your .profile file."
end
puts " It might not take effect until you log out and back in."
# email forwarding
sep