From 5992ae4f1bd18c521b7d83d9cf6502f7c471ed9a Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Fri, 13 Oct 2023 08:55:04 +0000 Subject: [PATCH] add ssh key to agent --- start.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/start.py b/start.py index 408b43b..b80d796 100644 --- a/start.py +++ b/start.py @@ -96,8 +96,18 @@ def setup(self, _=None): ) return self.store_the_keys(*keys) + + # Add the key to the ssh-agent. + self.add_key_to_ssh_agent() + self.output.value = "The keys were updated 👍" + def add_key_to_ssh_agent(self): + """Add the key to the ssh-agent.""" + subprocess.run( + ["ssh-add", "-t", "1d", str(self.private_key_file)], encoding="utf-8", check=True, + ) + def get_keys(self): headers = {"Content-Type": "application/json", "Accept": "application/json"}