@@ -94,6 +94,7 @@ def setup_git(logger: logging.Logger) -> None:
94
94
"sudo -u git bash -c 'mkdir -p ~/.ssh && chmod 700 ~/.ssh && touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys'" ,
95
95
"sets up .ssh directory for git" ,
96
96
),
97
+ ("sudo touch /etc/shells" , "creates /etc/shells if it doesn't exists yet" ),
97
98
("cat /etc/shells" , "views available shells" ),
98
99
("sudo which git-shell >> /etc/shells" , "adds git-shell to /etc/shells" ),
99
100
(
@@ -108,7 +109,7 @@ def setup_git(logger: logging.Logger) -> None:
108
109
109
110
def is_safe_directory_added (safe_directory : str ) -> bool :
110
111
# Run command to get all safe directories
111
- command = "git config --system --get-all safe.directory"
112
+ command = "sudo git config --system --get-all safe.directory"
112
113
stdout , stderr , exit_code = run_command (command )
113
114
114
115
# Check if the directory is listed
@@ -123,7 +124,7 @@ def add_safe_directory(safe_directory: str, logger: logging.Logger) -> None:
123
124
# Check if the directory is already added
124
125
if not is_safe_directory_added (safe_directory ):
125
126
# Command to add the directory to safe.directory
126
- command = f"git config --system --add safe.directory { safe_directory } "
127
+ command = f"sudo git config --system --add safe.directory { safe_directory } "
127
128
stdout , stderr , exit_code = run_command (command )
128
129
129
130
if exit_code == 0 :
0 commit comments