From 3d44217baf599a597e3c6c0d73de9dc86ffbfb85 Mon Sep 17 00:00:00 2001 From: shimataro Date: Mon, 8 Mar 2021 17:53:38 +0900 Subject: [PATCH] ignore known_hosts if no_known_hosts is true --- lib/index.js | 18 ++++++++++-------- src/main.ts | 19 +++++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/lib/index.js b/lib/index.js index 5c07890..5d3bb87 100644 --- a/lib/index.js +++ b/lib/index.js @@ -447,14 +447,6 @@ function main() { }); // files to be created const files = [ - { - name: "known_hosts", - contents: insertLf(knownHosts, true, true), - options: { - mode: 0o644, - flag: "a", - }, - }, { name: "config", contents: insertLf(config, true, true), @@ -474,6 +466,16 @@ function main() { }, }); } + if (!noKnownHosts) { + files.push({ + name: "known_hosts", + contents: insertLf(knownHosts, true, true), + options: { + mode: 0o644, + flag: "a", + }, + }); + } // create files for (const file of files) { const fileName = path_1.default.join(dirName, file.name); diff --git a/src/main.ts b/src/main.ts index 3670892..75ab350 100644 --- a/src/main.ts +++ b/src/main.ts @@ -39,14 +39,6 @@ function main(): void // files to be created const files: FileInfo[] = [ - { - name: "known_hosts", - contents: insertLf(knownHosts, true, true), - options: { - mode: 0o644, - flag: "a", - }, - }, { name: "config", contents: insertLf(config, true, true), @@ -67,6 +59,17 @@ function main(): void }, }); } + if(!noKnownHosts) + { + files.push({ + name: "known_hosts", + contents: insertLf(knownHosts, true, true), + options: { + mode: 0o644, + flag: "a", + }, + }); + } // create files for(const file of files)