-
Notifications
You must be signed in to change notification settings - Fork 56
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
Uses LAN and USB flags properly #360
Conversation
@@ -68,7 +72,7 @@ Tessel.list = function(opts) { | |||
// Report that selected Tessel to the user | |||
logs.info('Multiple Tessels found.'); | |||
if (tessel) { | |||
logs.info('Will default to', tessel.name, '.'); | |||
logs.info('Will default to', tessel.name + '.'); |
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.
This was bugging me because it was print out as: Will default to Frank .
with a space before the period.
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.
Now you use both ,
and +
on the same line.
edit: nvm, I just realized that it's to skip the space between the name and the period.
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.
Yeah, perhaps sprintf
is the reasonable way to do this?
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.
This should work and looks nice:
logs.info('Will default to %s.', tessel.name);
It uses util.format
which is a builtin in Node that does this. That works with console.log
as well 👍
> console.log('Hello %s.', 'world')
Hello world.
9eddc3f
to
4d4918c
Compare
@LinusU since you already started, do you want to give it a full review? |
Already on it ;) |
Code looks good, tests pass locally and on CI. The only thing is the one comment I made: - logs.info('Will default to', tessel.name + '.');
+ logs.info('Will default to %s.', tessel.name); LGTM 👍 |
Awesome, thanks a million! Will make that change and merge. |
4d4918c
to
e4e8c0f
Compare
Use LAN and USB flags properly
Turns out this was the root cause of #358 and #238. Probably more issues too, they just weren't reported.