Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

Commit

Permalink
Redirect ssh output if non-verbose
Browse files Browse the repository at this point in the history
If run without --verbose flag, send output from ssh-add command to dev/null
  • Loading branch information
randallreedjr committed Feb 6, 2019
1 parent 1339af2 commit 8d21aec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/git_switch/switcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ def set_git_config

def set_ssh
`git config #{git_config_flag} core.sshCommand "#{ssh_command}"`
`ssh-add #{ssh}`
if options.verbose?
`ssh-add #{ssh}`
else
`ssh-add #{ssh} 2>/dev/null`
end
end

def usage
Expand Down

0 comments on commit 8d21aec

Please sign in to comment.