From 43c2295b743cf3d0ab8d27b5623b5275200b6426 Mon Sep 17 00:00:00 2001 From: Adam Mustill Date: Sun, 7 Mar 2021 10:45:33 +0000 Subject: [PATCH] Check if we need to create SSH directory. (#6) --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9978612..a36c90b 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,10 @@ void function main() { function ssh() { let ssh = `${process.env['HOME']}/.ssh` - fs.mkdirSync(ssh) + + if (!fs.existsSync(ssh)) { + fs.mkdirSync(ssh) + } let authSock = '/tmp/ssh-auth.sock' execa.sync('ssh-agent', ['-a', authSock])