update helpers

This commit is contained in:
Dragan Filipovic 2023-01-02 11:41:31 +01:00
parent 1b6513031e
commit 7306f6bca0
5 changed files with 23 additions and 23 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env node
const { sshDeploy } = require('./rsyncCli');
const { remoteCmdBefore, remoteCmdAfter } = require('./remoteCmd');
const { addSshKey } = require('./sshKey');
const { addSshKey, getPrivateKeyPath } = require('./sshKey');
const { validateRequiredInputs } = require('./helpers');
const inputs = require('./inputs');
@ -16,7 +16,8 @@ const run = () => {
// Validate required inputs
validateRequiredInputs({ sshPrivateKey, remoteHost, remoteUser });
// Add SSH key
const privateKey = addSshKey(sshPrivateKey, deployKeyName);
addSshKey(sshPrivateKey, deployKeyName);
const { path: privateKeyPath } = getPrivateKeyPath(deployKeyName);
// Check Script before
if (scriptBefore) {
remoteCmdBefore(scriptBefore);
@ -31,7 +32,7 @@ const run = () => {
/* eslint-disable object-property-newline */
sshDeploy({
source, rsyncServer, exclude, remotePort,
privateKey, args, sshCmdArgs, callback
privateKeyPath, args, sshCmdArgs, callback
});
};