-
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
Add Node version output to t2 version
command
#679
Conversation
*/ | ||
Tessel.prototype.fetchCurrentNodeVersion = function() { | ||
return this.simpleExec(['node', '--version']) | ||
.then(function versionRead(version) { |
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.
Use arrow functions when you can.
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.
Okay. I was following what I saw, and it was a lot of mixed between function
keyword and arrow functions.
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.
I know.. 😄. Going forward we want to avoid adding more, and cleaning up as we go.
Updated based on @rwaldron feedback and rebased onto latest master. |
}) | ||
.catch(() => { | ||
logs.info(output('Firmware', firmwareVersion)); | ||
logs.info(output('Node', 'unknown')); |
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 work!! |
Thanks! More to come. |
Fixes #667
This adds additional information to the
t2 version
command. If for some reason it fails to fetch the Node version, but was able to get the firmware version, it will output just that along with unknown for the Node version.If it fails to get the firmware version first then it skips trying to get the Node version and just outputs unknown for both versions.
All the tests pass. There weren't any currently testing
controller.tesselFirmwareVerion
function, so I added those with this as well since I touched that function. I would love some feedback on the tests as I am pretty green with Sinon. :)Also, note that
Verion
above should beVersion
, but I opted to not correct the spelling and would tackle that in a separate PR. Trying not to do so much here, but if you would like, I could rename that in this PR as well.