Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
2ue committed Apr 29, 2024
1 parent ea7e694 commit fbfa5c0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 31 deletions.
62 changes: 31 additions & 31 deletions main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ async function run() {
const port = core.getInput('port') || 22
const username = core.getInput('username', { required: true })
const password = core.getInput('password', { required: true })
const forceIPv4 = core.getInput('forceIPv4')
const forceIPv6 = core.getInput('forceIPv6')
const agent = core.getInput('agent')
const privateKey = core.getInput('privateKey')
const passphrase = core.getInput('passphrase')
const readyTimeout = core.getInput('readyTimeout')
const strictVendor = core.getInput('strictVendor')
const debug = core.getInput('debug')
const retries = core.getInput('retries')
const retry_factor = core.getInput('retry_factor')
const retry_minTimeout = core.getInput('retry_minTimeout')
const promiseLimit = core.getInput('promiseLimit')
// const forceIPv4 = core.getInput('forceIPv4')
// const forceIPv6 = core.getInput('forceIPv6')
// const agent = core.getInput('agent')
// const privateKey = core.getInput('privateKey')
// const passphrase = core.getInput('passphrase')
// const readyTimeout = core.getInput('readyTimeout')
// const strictVendor = core.getInput('strictVendor')
// const debug = core.getInput('debug')
// const retries = core.getInput('retries')
// const retry_factor = core.getInput('retry_factor')
// const retry_minTimeout = core.getInput('retry_minTimeout')
// const promiseLimit = core.getInput('promiseLimit')
const localDir1 = core.getInput('local_dir', { required: true })
const localDir = path(__dirname, localDir1)
const localDir = path.join(__dirname, localDir1)
const remoteBaseDir = core.getInput('remote_base_dir', { required: true })
const remoteBakPath = core.getInput('remote_bak_path')
// const remoteBakPath = core.getInput('remote_bak_path')
try {
console.log('Start connect: ', localDir1, localDir)
execSync('pwd', { stdio: 'inherit' })
Expand All @@ -37,25 +37,25 @@ async function run() {
port,
username,
password,
forceIPv4,
forceIPv6,
agent,
privateKey,
passphrase,
readyTimeout,
strictVendor,
debug,
retries,
retry_factor,
retry_minTimeout,
promiseLimit
// forceIPv4,
// forceIPv6,
// agent,
// privateKey,
// passphrase,
// readyTimeout,
// strictVendor,
// debug,
// retries,
// retry_factor,
// retry_minTimeout,
// promiseLimit
})
if (remoteBakPath) {
console.log('Start Backup: ', remoteBaseDir, '=>', remoteBakPath)
await sftp.rcopy(remoteBaseDir, `${remoteBakPath}/backup`)
}
// if (remoteBakPath) {
// console.log('Start Backup: ', remoteBaseDir, '=>', remoteBakPath)
// await sftp.rcopy(remoteBaseDir, `${remoteBakPath}/backup`)
// }
console.log('Start upload: ', localDir, '=>', remoteBaseDir)
await sftp.uploadDir(localDir, `${remoteBaseDir}`, {
await sftp.uploadDir(localDir, remoteBaseDir, {
filter: (localPath, isDir) => {
core.debug('Upload: ', localPath, isDir)
return true
Expand Down
4 changes: 4 additions & 0 deletions main/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const { execSync } = require('child_process')


execSync('ls -al', { stdio: 'inherit' })

0 comments on commit fbfa5c0

Please sign in to comment.