Skip to content

Added solution#336

Open
YevheniiKa wants to merge 4 commits intomate-academy:masterfrom
YevheniiKa:develop
Open

Added solution#336
YevheniiKa wants to merge 4 commits intomate-academy:masterfrom
YevheniiKa:develop

Conversation

@YevheniiKa
Copy link

Added solution to the task.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Great work on implementing the core file-moving logic and creating a very thorough test suite! Your tests cover all the required scenarios well.

However, this requires changes related to error handling. In several places in src/app.js, when a validation check fails (like when the source isn't a file or a destination directory doesn't exist), you correctly log an error message. The issue is that the script continues to run afterward, which can lead to more confusing errors from the fs module later and doesn't fully meet the requirements.

To fix this, please ensure the process terminates after logging a validation error. You can achieve this by calling process.exit(1) right after your console.error statements. This will make the application's behavior more robust and align with the task requirements for handling invalid inputs.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Excellent work on this iteration! You've successfully addressed the previous feedback by ensuring the script terminates on validation errors. I am requesting one final, important change before approval. Currently, the application exits with process.exit(0) even when an error occurs, such as a missing argument or a file system error. Standard practice for command-line tools is to exit with a non-zero code (e.g., 1) to signal failure, which is critical for scripting and automation. Please update the error-handling blocks in src/app.js to use process.exit(1) instead. Once that's done, this will be perfect!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

I am approving this submission as an educational override to help you progress. You've correctly implemented the core file-moving logic, which is great! However, the critical feedback from the previous review regarding exit codes still needs to be addressed. In src/app.js, after every console.error call for validation or runtime errors, you must add process.exit(1); to signal that the script has failed. This is a fundamental requirement for command-line tools. Once you add this, you will also need to update your tests to handle rejected promises, as the execAsync calls for error cases will now fail as expected. Keep up the great work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants