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 #335

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

Conversation

Patryk-Buczkowski
Copy link

No description provided.

Copy link

@natalia-klonowska natalia-klonowska left a comment

Choose a reason for hiding this comment

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

even if the number of arguments is incorrect, cp function will still be called

@Patryk-Buczkowski
Copy link
Author

even if the number of arguments is incorrect, cp function will still be called

i am not sure what you mean because it show err

image

Copy link

@Zibi95 Zibi95 left a comment

Choose a reason for hiding this comment

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

It will show error but the cp function will run. You only show the error in the console it will still proceed with the code execution after that.

Comment on lines +9 to +14
if (args.length !== 2) {
console.error('Usage: node yourScript.js <source> <destination>');

return;
}

Choose a reason for hiding this comment

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

I didn't mean for you to move this condition inside function but rather to add else statement so that if an error occurs there's no need to run the function ;)

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.

3 participants