File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 * Our shim for nodebb production mode and PM2 compatibility.
33 */
44const { exec } = require ( 'child_process' ) ;
5- const startCmd = './nodebb start' ;
6- const stopCmd = './nodebb stop' ;
5+ const startCmd = 'nodebb start' ;
6+ const stopCmd = 'nodebb stop' ;
7+ const nvmCmd = 'bash -c "export NVM_DIR=/opt/nvm && source /opt/nvm/nvm.sh && nvm use && ' ;
78
89const start = ( ) => {
910 console . log ( 'Starting nodebb...' ) ;
10- exec ( startCmd , ( error , stdout , stderr ) => {
11+ exec ( nvmCmd + startCmd + '"' , ( error , stdout , stderr ) => {
1112 if ( error ) {
1213 console . error ( `Error starting nodebb: ${ error } ` ) ;
1314 } else {
@@ -18,7 +19,7 @@ const start = () => {
1819
1920const stop = ( ) => {
2021 console . log ( 'Stopping nodebb...' ) ;
21- exec ( stopCmd , ( error , stdout , stderr ) => {
22+ exec ( nvmCmd + stopCmd + '"' , ( error , stdout , stderr ) => {
2223 if ( error ) {
2324 console . error ( `Error stopping nodebb: ${ error } ` ) ;
2425 } else {
You can’t perform that action at this time.
0 commit comments