From ae0f16bf35e707ffe2e06741f5c54ec293964a6a Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Wed, 26 Jun 2024 13:58:17 +0800 Subject: [PATCH] chore: doc --- .../ui/certd-server/src/plugins/plugin-host/lib/ssh.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/ui/certd-server/src/plugins/plugin-host/lib/ssh.ts b/packages/ui/certd-server/src/plugins/plugin-host/lib/ssh.ts index 53eb1ddb..c23a1be0 100644 --- a/packages/ui/certd-server/src/plugins/plugin-host/lib/ssh.ts +++ b/packages/ui/certd-server/src/plugins/plugin-host/lib/ssh.ts @@ -45,12 +45,13 @@ export class AsyncSsh2Client { async fastPut(options: { sftp: any; localPath: string; remotePath: string }) { const { sftp, localPath, remotePath } = options; return new Promise((resolve, reject) => { - this.logger.info(`上传文件:${localPath} => ${remotePath}`); + this.logger.info(`开始上传:${localPath} => ${remotePath}`); sftp.fastPut(localPath, remotePath, (err: Error) => { if (err) { reject(err); return; } + this.logger.info(`上传文件成功:${localPath} => ${remotePath}`); resolve({}); }); }); @@ -139,12 +140,12 @@ export class SshClient { connectConf, callable: async (conn: AsyncSsh2Client) => { const sftp = await conn.getSftp(); + this.logger.info('开始上传'); for (const transport of transports) { - this.logger.info('上传文件:', JSON.stringify(transport)); await conn.exec(`mkdir -p ${path.dirname(transport.remotePath)} `); await conn.fastPut({ sftp, ...transport }); } - this.logger.info('文件上传成功'); + this.logger.info('文件全部上传成功'); }, }); }