Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(packages/scripts): fix the file tranfer from remote to local #504

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

wuhuizuo
Copy link
Contributor

The ssh2-sftp-client npm package is compatible with Deno.

Signed-off-by: wuhuizuo wuhuizuo@126.com

The ssh2-sftp-client npm package is compatible with Deno.

Signed-off-by: wuhuizuo <wuhuizuo@126.com>
@ti-chi-bot ti-chi-bot bot requested a review from purelind December 11, 2024 09:22
Copy link

ti-chi-bot bot commented Dec 11, 2024

I have already done a preliminary review for you, and I hope to help you do a better job.

Based on the pull request title and description, it seems that the changes are related to fixing a file transfer issue from a remote host to a local host using the ssh2-sftp-client npm package.

Looking at the diff, the main changes are:

  • Importing the SftpClient from the ssh2-sftp-client npm package.
  • Modifying the build function to accept the SftpClient as an argument and use it to download files from the remote host to the local host.
  • Adding a console.info statement to show the downloaded results.

One potential problem I see is that the sftp.downloadDir method is called with an incorrect number of arguments. According to the documentation, it should be called with three arguments: remoteDir, localDir, and an options object. However, in this pull request, it is called with only two arguments: remoteDir and localDir. This may cause the download to fail.

To fix this, the sftp.downloadDir method should be called with the correct number of arguments, like this:

await sftp.downloadDir(
    path.join(remoteCwd, options.releaseDir),
    options.releaseDir,
    { recursive: true },
);

Another suggestion for improvement is to handle errors and exceptions properly, such as catching errors thrown by the sftp.downloadDir method and logging them to the console. This can help with debugging and troubleshooting in case of issues.

Overall, the changes seem reasonable and should fix the file transfer issue. However, it's important to ensure that the code is thoroughly tested before merging the pull request to avoid introducing new issues or regressions.

@ti-chi-bot ti-chi-bot bot added the size/M label Dec 11, 2024
@wuhuizuo
Copy link
Contributor Author

/approve

Copy link

ti-chi-bot bot commented Dec 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wuhuizuo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Dec 11, 2024
@ti-chi-bot ti-chi-bot bot merged commit 177b31e into main Dec 11, 2024
3 checks passed
@ti-chi-bot ti-chi-bot bot deleted the fix/darwin-builds-targz branch December 11, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant