-
Notifications
You must be signed in to change notification settings - Fork 1
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
Run iCub telemetry server and openMCT visualizer in one line command: Iteration 2/2 #32
Conversation
…sion>' in a child process
- Replaced the hardcoded nvm.sh path with path computed from NVM_DIR. - Used require('paht').join to build paths, for more portability. - Applied 'nvmVersion' input parameter. - 'nvm use \<version\>' can be run from anywhere in the repo, since it only impacts the shell environment variables.
79c6fca
to
392b05c
Compare
- Call the method in the main script. - fix the node.js version selection: the 'PATH' variable was missing among those updated by "nvm use vxxx" command. - Set the updated variables {PATH,NVM_INC,NVM_BIN} in the options of the spawn command running the "npm start" command. - Warining: do not use "=" operator to copy objects, but instead the 'Object.assign()' method. - Inside the callbacks, for 'this' to be the 'OpenMctServerHandler' object instead of the callback caller, we need to back it up in a variable 'embeddedThis'.
The child process running the openmctStaticServer is already properly launched by the iCubTelemVizServer, such that we run everything by running "npm start" in the openmctStaticServer folder. But stopping the servers or aborting is still not working properly, I'm still working on it. |
…nstead of 'execSync' command. - Refactor 'OpenMctServerHandler.setNvmVersion' fo an eventual later use. - Add '. ${NVM_DIR}/nvm.sh; nvm use vX.X.X;' in the start scripts of 'iCubTelemVizServer' and 'openmctStaticServer'. The first instruction defines the 'nvm' function, while the second sets the nodejs version. In this case, the 'npm' process running the start script can be launched by a 'spawn' command. Unlike running the command 'nvm use vX.X.X' directly through 'spawn', using here an intermediate script ("start") avoids the EACCES problem encountered previously.
44ba79d
to
6b94e99
Compare
I've implemented a small improvement/simplification for handling the Node.js versions.
On top of that, the fix for properly closing the servers will be tracked in #34 , refer to #25 (comment). So, I would consider the work complete here. |
This actually simplifies the documentation. The README will be updated in #22 where also tracked the other feedback from @traversaro . |
Hi @S-Dafarra , I'm adding you as a reviewer for avoiding to load @traversaro with 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.
Just a curiosity regarding the portability on Windows. Also, I am not familiar at all with the language, so I was not able to provide an in depth review
Implements #25 . (iteration 2/2)