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

Solution #358

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

AndriiZakharenko
Copy link

No description provided.

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.

Great job on implementing the file copy functionality! 🎉 Your code meets the task requirements and constraints effectively. It correctly handles the case where the source and destination are the same, and it logs errors appropriately. Just a small suggestion: consider adding a return statement after logging an error when the destination argument is missing to prevent further execution. Keep up the good work! 😊

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

Comment on lines +9 to +11
if (!dest) {
console.error('Please provide two arguments');
}

Choose a reason for hiding this comment

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

The code checks if the destination argument is missing and logs an error message, but it does not exit the function. Consider adding a return statement after logging the error to prevent further execution.

}

try {
if (src && dest && src !== dest) {

Choose a reason for hiding this comment

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

The condition src !== dest is checked, which is good to prevent copying a file onto itself. However, ensure that this logic is intended and correctly handles cases where the source and destination are the same.

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