mirror of
https://github.com/webfactory/ssh-agent.git
synced 2025-06-28 05:33:45 +00:00
Acknowledge custom command inputs in cleanup.js (#235)
Refactored version of https://github.com/webfactory/ssh-agent/pull/183. Fixes: https://github.com/webfactory/ssh-agent/issues/208
This commit is contained in:
parent
b504c19775
commit
e3f1a8e046
6 changed files with 87 additions and 95 deletions
14
paths.js
14
paths.js
|
@ -1,6 +1,7 @@
|
|||
const os = require('os');
|
||||
const core = require('@actions/core');
|
||||
|
||||
module.exports = (process.env['OS'] != 'Windows_NT') ? {
|
||||
const defaults = (process.env['OS'] != 'Windows_NT') ? {
|
||||
// Use getent() system call, since this is what ssh does; makes a difference in Docker-based
|
||||
// Action runs, where $HOME is different from the pwent
|
||||
homePath: os.userInfo().homedir,
|
||||
|
@ -14,3 +15,14 @@ module.exports = (process.env['OS'] != 'Windows_NT') ? {
|
|||
sshAddCmdDefault: 'c://progra~1//git//usr//bin//ssh-add.exe',
|
||||
gitCmdDefault: 'c://progra~1//git//bin//git.exe'
|
||||
};
|
||||
|
||||
const sshAgentCmdInput = core.getInput('ssh-agent-cmd');
|
||||
const sshAddCmdInput = core.getInput('ssh-add-cmd');
|
||||
const gitCmdInput = core.getInput('git-cmd');
|
||||
|
||||
module.exports = {
|
||||
homePath: defaults.homePath,
|
||||
sshAgentCmd: sshAgentCmdInput !== '' ? sshAgentCmdInput : defaults.sshAgentCmdDefault,
|
||||
sshAddCmd: sshAddCmdInput !== '' ? sshAddCmdInput : defaults.sshAddCmdDefault,
|
||||
gitCmd: gitCmdInput !== '' ? gitCmdInput : defaults.gitCmdDefault,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue