Skip to content

Commit

Permalink
more spaghetti at the wall
Browse files Browse the repository at this point in the history
  • Loading branch information
apokalyptik committed Mar 25, 2020
1 parent 2863e02 commit 034d210
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 034d210

Please sign in to comment.