From f0cc491ed9e0808aba3b80185b9033db20e22a4d Mon Sep 17 00:00:00 2001 From: deepend-tildeclub <58404188+deepend-tildeclub@users.noreply.github.com> Date: Fri, 9 Aug 2024 15:27:15 -0600 Subject: [PATCH] Update welcome.rb add zsh timezone logic. --- welcome.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/welcome.rb b/welcome.rb index ac8928b..7b05be5 100644 --- a/welcome.rb +++ b/welcome.rb @@ -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