From 034d21096921d84a4fafa4008c8e5b889b002df9 Mon Sep 17 00:00:00 2001 From: Demitrious Kelly Date: Wed, 25 Mar 2020 15:15:12 -0700 Subject: [PATCH] more spaghetti at the wall --- dist/index.js | 8 ++++---- src/main.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 67febc7..0ea1a93 100644 --- a/dist/index.js +++ b/dist/index.js @@ -667,10 +667,10 @@ function run() { const userArguments = getUserArguments(); if ('' !== userArguments.knownHosts) { try { - yield exec.exec(`mkdir -v -p $HOME/.ssh`); - yield exec.exec(`chmod 700 $HOME/.ssh`); - yield exec.exec(`echo ${userArguments.knownHosts} > $HOME/.ssh/known_hosts`); - yield exec.exec(`chmod 755 $HOME/.ssh/known_hosts`); + yield exec.exec(`mkdir -v -p ${process.env['HOME']}/.ssh`); + yield exec.exec(`chmod 700 ${process.env['HOME']}/.ssh`); + yield exec.exec(`echo "${userArguments.knownHosts}" > ${process.env['HOME']}/.ssh/known_hosts`); + yield exec.exec(`chmod 755 ${process.env['HOME']}/.ssh/known_hosts`); console.log("✅ Configured known_hosts"); } catch (error) { diff --git a/src/main.ts b/src/main.ts index 64973d9..4011b72 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,10 +6,10 @@ async function run() { const userArguments = getUserArguments(); if ( '' !== userArguments.knownHosts ) { try { - await exec.exec(`mkdir -v -p $HOME/.ssh`); - await exec.exec(`chmod 700 $HOME/.ssh`); - await exec.exec(`echo ${userArguments.knownHosts} > $HOME/.ssh/known_hosts`); - await exec.exec(`chmod 755 $HOME/.ssh/known_hosts`); + await exec.exec(`mkdir -v -p ${process.env['HOME']}/.ssh`); + await exec.exec(`chmod 700 ${process.env['HOME']}/.ssh`); + await exec.exec(`echo "${userArguments.knownHosts}" > ${process.env['HOME']}/.ssh/known_hosts`); + await exec.exec(`chmod 755 ${process.env['HOME']}/.ssh/known_hosts`); console.log("✅ Configured known_hosts"); } catch( error ) { console.error("⚠️ Error configuring known_hosts")