@@ -96,15 +96,6 @@ public function setup( $args ) {
96
96
$ config = str_replace ( '%nodebb_url% ' , $ url , $ config );
97
97
file_put_contents ( $ nodebb_folder . '/config.json ' , $ config );
98
98
99
- // Update proxy and restart nginx
100
- if ( $ nodeapp_folder . '/ ' == $ nodebb_folder ) {
101
- $ hcpp ->run ( "change-web-domain-proxy-tpl $ user $ domain NodeApp " );
102
- }else {
103
- $ hcpp ->nodeapp ->generate_nginx_files ( $ nodeapp_folder );
104
- $ hcpp ->nodeapp ->startup_apps ( $ nodeapp_folder );
105
- $ hcpp ->run ( "restart-proxy " );
106
- }
107
-
108
99
// Run initial setup
109
100
$ setup = './nodebb setup ' ;
110
101
$ setup .= "' " .
@@ -116,11 +107,20 @@ public function setup( $args ) {
116
107
] ) . "' \n" ;
117
108
$ setup .= "./nodebb restart \n" ;
118
109
file_put_contents ( $ nodebb_folder . '/setup.sh ' , $ setup );
119
- $ cmd = 'runuser -s /bin/bash -l ' . $ user . ' -c "cd ' . $ nodebb_folder . ' && source setup.sh" ' . "\n" ;
110
+ $ cmd = 'runuser -s /bin/bash -l ' . $ user . ' -c "export NVM_DIR=/opt/nvm && source /opt/nvm/nvm.sh && ' ;
111
+ $ cmd .= 'cd ' . $ nodebb_folder . ' && source setup.sh" ' . "\n" ;
120
112
$ cmd .= '#rm -f ' . $ nodebb_folder . 'setup.sh ' ;
121
113
$ hcpp ->log ( $ cmd );
122
114
$ hcpp ->log (shell_exec ( $ cmd ));
123
-
115
+
116
+ // Update proxy and restart nginx
117
+ if ( $ nodeapp_folder . '/ ' == $ nodebb_folder ) {
118
+ $ hcpp ->run ( "change-web-domain-proxy-tpl $ user $ domain NodeApp " );
119
+ }else {
120
+ $ hcpp ->nodeapp ->generate_nginx_files ( $ nodeapp_folder );
121
+ $ hcpp ->nodeapp ->startup_apps ( $ nodeapp_folder );
122
+ $ hcpp ->run ( "restart-proxy " );
123
+ }
124
124
return $ args ;
125
125
}
126
126
0 commit comments