diff --git a/lib/index.js b/lib/index.js index 0fe2f6d..3a2345a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -485,6 +485,10 @@ function getHomeDirectory() { if (home === undefined) { throw Error(`${homeEnv} is not defined`); } + if (home === "/github/home") { + // Docker container + return "/root"; + } return home; } /** diff --git a/src/main.ts b/src/main.ts index 3f4ad22..b39d10c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -63,7 +63,7 @@ function main(): void fs.writeFileSync(fileName, file.contents, file.options); } - console.log(`SSH key has been stored to ${dirName} successfully. / ${home}`); + console.log(`SSH key has been stored to ${dirName} successfully.`); } catch(err) { @@ -84,6 +84,12 @@ function getHomeDirectory(): string throw Error(`${homeEnv} is not defined`); } + if(home === "/github/home") + { + // Docker container + return "/root"; + } + return home; }