@colyseus/tools 0.15.48 → 0.15.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/pm2/post-deploy-agent.js +4 -6
package/package.json
CHANGED
package/pm2/post-deploy-agent.js
CHANGED
|
@@ -79,21 +79,19 @@ function postDeploy(cwd, reply) {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
console.log("apps[0].pm2_env.pm_cwd =>", apps[0].pm2_env.pm_cwd);
|
|
83
|
-
console.log("cwd =>", cwd);
|
|
84
|
-
|
|
85
82
|
//
|
|
86
83
|
// detect if cwd has changed, and restart PM2 if it has
|
|
87
84
|
//
|
|
88
85
|
if (apps[0].pm2_env.pm_cwd !== cwd) {
|
|
89
|
-
console.log("
|
|
86
|
+
console.log("App Root Directory changed. Restarting may take a bit longer...");
|
|
90
87
|
|
|
91
88
|
//
|
|
92
89
|
// remove all and start again with new cwd
|
|
93
90
|
//
|
|
94
|
-
return pm2.delete(
|
|
91
|
+
return pm2.delete('all', function (err) {
|
|
92
|
+
logIfError(err);
|
|
93
|
+
|
|
95
94
|
// start again
|
|
96
|
-
// (TODO: make sure CWD is actually changed after this...)
|
|
97
95
|
pm2.start(config, { ...opts }, (err, result) => {
|
|
98
96
|
reply({ success: !err, message: err?.message });
|
|
99
97
|
updateAndSave(err, result);
|