-
Notifications
You must be signed in to change notification settings - Fork 408
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 #343
base: master
Are you sure you want to change the base?
Solution #343
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 🔥
Let's improve your solution
src/app.js
Outdated
rl.close(); | ||
}; | ||
|
||
rl.question('', handleUserInput); |
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.
rl.question('', handleUserInput); | |
rl.question('Enter command: ', handleUserInput); |
src/app.js
Outdated
|
||
console.log('File copied successfully'); | ||
} catch (error) { | ||
console.error(error); |
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.
Changed error messages to be more descriptive
console.error(error); | |
console.error('Error during file copy:', error.message); |
|
||
return; | ||
} | ||
|
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.
Add validation to ensure both the source and destination are provided
if (!src || !dest) { | |
console.error('Error: Please provide both source and destination files.'); | |
rl.close(); | |
return; | |
} |
I have a question: why do tests go into an infinite loop and how do we solve this issue? |
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.
Everything completed and looking good 🔥
I'll come back later to you private chat with an answer to the question ))
No description provided.