Some direction on troubleshooting and working with the startup services that the CLI works with. Utilizes the packages node-mac, node-windows, and node-linux to help manage the system processes.
Mac makes use of registering plist files for the user that dictates what services to startup when a user logs into their computer.
Because of a limitation of the packages we are using to manage the startup, we have to start the process through startup.js and then execute a bash script run.sh to establish the correct running environment for machines that are using nvm
./bin/dev.js startto start and enable services- On any change that you need to see reflected in the plist:
./bin/dev.js startup:disableto stop and disable services and thenrm -rf ~/Library/LaunchAgents/codeclimbers.plist./bin/dev.js startto see reflected changes
from an older way of managing the services that we were managing the plist directly instead of using the packages The startup.plist.ts file is what creates the plist file that is dynamic to the users' system. I have been testing the process of loading the plist file by doing the following:
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/io.codeclimbers.plistto unload application if it is already registered.- At project root
./bin/dev.js startto mimic someone running the start command for the first time. - Read logs for issues with start command
tail -f ~/.codeclimbers/log.errandtail -f ~/.codeclimbers/log.outfor logging from the application.
from an older way of managing the services that we were managing the plist directly instead of using the packages
launchctl bootstrap gui/$(id -u) io.codeclimbers.plistto load service. The program will start as soon as it is loaded and be added to registry of startup services.launchctl bootout gui/$(id -u) io.codeclimbers.plistto unload service. The program will stop as soon as unloaded and be removed from registry of startup services.launchctl list io.codeclimbers.plistto show last error status and program arguments being used on startuptail -f ~/.codeclimbers/log.errto view latest errorstail -f ~/.codeclimbers/log.outto view latest application logs
We are executing a bash script ./bin/run.sh instead of ./bin/run.js to make sure nvm is supported regardless of
where the user puts their nvm export script (.zshrc for example).
To be built
To be built