Update welcome.rb

add zsh timezone logic.
This commit is contained in:
deepend-tildeclub 2024-08-09 15:27:15 -06:00 committed by GitHub
parent 7e0f140f50
commit f0cc491ed9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 3 deletions

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