Skip to content

Commit a62e1d4

Browse files
Merge pull request #18 from aligent/fix/newlines-ssh
fix: config file isn't required
2 parents d8d1181 + ab3257a commit a62e1d4

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

lib/ssh.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,11 @@ export async function setupSshCredentials(): Promise<void> {
2929

3030
// Ensure all the required directories and files exist
3131
// If these don't exist, we can't continue
32-
const pathsToCheck = [
33-
sshConfigDir,
34-
identityFile,
35-
knownHostsFile,
36-
configFile,
37-
];
32+
const pathsToCheck = [sshConfigDir, identityFile, knownHostsFile];
3833
for (const path of pathsToCheck) {
3934
if (!(await pathExists(path))) {
4035
console.error(
41-
`${path} not found. Check that the SSH configuration is valid.`
36+
`${path} not found. Check that the SSH configuration is valid.`,
4237
);
4338
return;
4439
}
@@ -55,13 +50,13 @@ export async function setupSshCredentials(): Promise<void> {
5550

5651
await fs.promises.appendFile(
5752
configFile,
58-
`\nIdentityFile ${pipelinesIdFile}\n`
53+
`\nIdentityFile ${pipelinesIdFile}\n`,
5954
);
6055
} catch (e) {
6156
console.error(
6257
`Failed to update SSH configuration, check that SSH key configuration in Pipelines is valid. \n Check Pipelines -> SSH Keys.\n\n ${
6358
(e as Error).message
64-
}`
59+
}`,
6560
);
6661
return;
6762
}
@@ -75,7 +70,7 @@ export async function setupSshCredentials(): Promise<void> {
7570
await fs.promises.appendFile(hostsFile, knownHosts);
7671
} catch (e) {
7772
console.error(
78-
'Failed to update hosts file. \n Check Pipelines configuration for known hosts.'
73+
'Failed to update hosts file. \n Check Pipelines configuration for known hosts.',
7974
);
8075
return;
8176
}

0 commit comments

Comments
 (0)