@colyseus/tools 0.15.34 → 0.15.35
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/post-deploy.js +17 -9
package/package.json
CHANGED
package/post-deploy.js
CHANGED
|
@@ -42,11 +42,12 @@ pm2.list(function(err, apps) {
|
|
|
42
42
|
// remove all and start again with new cwd
|
|
43
43
|
//
|
|
44
44
|
pm2.delete('all', function(err) {
|
|
45
|
-
// force to remove ~/.pm2 folder to avoid conflicts
|
|
46
|
-
fs.rmdirSync(path.join(process.env.HOME, '.pm2'), { recursive: true });
|
|
47
45
|
|
|
48
|
-
// start again
|
|
49
|
-
pm2.
|
|
46
|
+
// kill & start again
|
|
47
|
+
pm2.kill(function() {
|
|
48
|
+
pm2.start(CONFIG_FILE, { ...opts }, onAppRunning);
|
|
49
|
+
});
|
|
50
|
+
|
|
50
51
|
});
|
|
51
52
|
|
|
52
53
|
} else {
|
|
@@ -89,7 +90,7 @@ function updateColyseusBootService() {
|
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
const workingDirectory = pm2.cwd;
|
|
92
|
-
const execStart = `${detectPackageManager()}
|
|
93
|
+
const execStart = `${detectPackageManager()} colyseus-post-deploy`;
|
|
93
94
|
|
|
94
95
|
const contents = fs.readFileSync(COLYSEUS_CLOUD_BOOT_SERVICE, 'utf8');
|
|
95
96
|
try {
|
|
@@ -145,10 +146,17 @@ function updateAndReloadNginx() {
|
|
|
145
146
|
|
|
146
147
|
function detectPackageManager() {
|
|
147
148
|
const lockfiles = {
|
|
148
|
-
npm
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
// npm
|
|
150
|
+
"npm exec": path.resolve(pm2.cwd, 'package-lock.json'),
|
|
151
|
+
|
|
152
|
+
// yarn
|
|
153
|
+
"yarn exec": path.resolve(pm2.cwd, 'yarn.lock'),
|
|
154
|
+
|
|
155
|
+
// pnpm
|
|
156
|
+
"pnpm exec": path.resolve(pm2.cwd, 'pnpm-lock.yaml'),
|
|
157
|
+
|
|
158
|
+
// bun
|
|
159
|
+
"bunx": path.resolve(pm2.cwd, 'bun.lockb'),
|
|
152
160
|
};
|
|
153
161
|
|
|
154
162
|
for (const [key, value] of Object.entries(lockfiles)) {
|