File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44
55[project ]
66name = " sshkey-switch"
7- version = " 0.2 .0"
7+ version = " 0.4 .0"
88description = " A command-line tool for switching SSH keys"
99readme = " README.md"
1010authors = [
Original file line number Diff line number Diff line change 1111import sys
1212import re
1313import shutil
14+ import platform
1415import subprocess
1516from pathlib import Path
1617from collections import OrderedDict
2829ACTIVATION_MESSAGE = False
2930EXCLUDE_FILES = {"authorized_keys" , "known_hosts" }
3031
31- def get_os_shell_profile () -> Path | None :
32- """Returns the appropriate shell profile file path based on the user's current shell."""
33- shell = os .getenv ("SHELL" , "" ).split ('/' )[- 1 ].lower ()
34-
35- shell_profiles = {
36- "bash" : BASHRC_FILE ,
37- "zsh" : ZSHRC_FILE
38- }
39-
40- return shell_profiles .get (shell , None ) # Return None for unsupported shells
32+ def get_os_shell_profile ():
33+ """Return the correct shell profile file based on OS."""
34+ return ZSHRC_FILE if platform .system () == "Darwin" else BASHRC_FILE
4135
4236def check_ssh_environment ():
4337 """Check if /root/.ssh directory and ssh-agent binary exist."""
You can’t perform that action at this time.
0 commit comments