Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
vraravam committed Dec 18, 2024
1 parent db3c904 commit 4504782
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/install-dotfiles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def override_into_home_folder(file, dotfiles_dir_length)

ssh_folder = Pathname.new(HOME) + '.ssh'
default_ssh_config = ssh_folder + 'config'
# Note: '~/.ssh/global_config' symlink will exist from the above lines
# Note: '${HOME}/.ssh/global_config' symlink will exist from the above lines
if (ssh_folder + 'global_config').exist?
FileUtils.touch(default_ssh_config) unless default_ssh_config.exist?

include_line = 'Include ~/.ssh/global_config'
include_line = 'Include ${HOME}/.ssh/global_config'
last_two_lines = default_ssh_config.readlines(chomp: true)[-2..-1] || []

File.write(default_ssh_config, "\n#{include_line}\n", mode: 'a+') unless last_two_lines.include?(include_line)
Expand Down

0 comments on commit 4504782

Please sign in to comment.