-
Notifications
You must be signed in to change notification settings - Fork 427
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
Develop #375
base: master
Are you sure you want to change the base?
Develop #375
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on structuring your code to handle file operations effectively! 🎉 While your solution meets the task requirements, there are a few critical issues that need attention. Ensure you update the condition to check for the correct number of arguments (args.length !== 2
) and add process.exit(1);
after logging errors to indicate an error status. Keep up the good work and happy coding! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
src/app.js
Outdated
|
||
console.log('Command-line arguments:', args); | ||
|
||
if (args.length === 4) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition args.length === 4
is incorrect for checking the number of command-line arguments. It should be args.length !== 2
to ensure exactly two arguments (source and destination) are provided.
src/app.js
Outdated
console.error('Source is not a file.'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After logging the error 'Source is not a file.', the program should exit with a non-zero status to indicate an error. Consider adding process.exit(1);
here.
src/app.js
Outdated
console.error('Destination is a directory.'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After logging the error 'Destination is a directory.', the program should exit with a non-zero status to indicate an error. Consider adding process.exit(1);
here.
No description provided.