Skip to content

Commit

Permalink
fix: pm2 not launching process (#225)
Browse files Browse the repository at this point in the history
* fix: pm2 not launching process

clean tsc build directory on build

* chore: use tsc --build flag
  • Loading branch information
jejebecarte authored Sep 26, 2024
1 parent e6f936d commit 3572737
Show file tree
Hide file tree
Showing 4 changed files with 770 additions and 11 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,11 @@ $ pnpm start

If you are self-hosting or your process manager does not automatically restart the bot in the event of a crash, you may use [PM2](https://pm2.keymetrics.io/), a process manager for Node.js applications.

1. Install PM2.
Use the `pm2:start` script instead of the `start` script to launch the bot. To stop the process, use the `pm2:kill` script.

```bash
$ pnpm add pm2
```

2. Use the `pm2` script instead of the `start` script to launch the bot.

```bash
$ pnpm run pm2
$ pnpm run pm2:start
$ pnpm run pm2:kill
```

Please refer to the [PM2 Documentation](https://pm2.keymetrics.io/docs/usage/quick-start/) for more configuration options and information about PM2.
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"license": "MIT",
"private": false,
"scripts": {
"build": "tsc && tsc-alias",
"build": "tsc --build --clean && tsc-alias",
"clean": "rm -r dist/",
"dev": "ts-node-dev --respawn --transpile-only --poll -r tsconfig-paths/register src/index.ts",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"pm2": "pm2 logs && pm2 start dist/index.js --name bridge",
"pm2:kill": "pm2 kill",
"pm2:start": "pm2 start dist/index.js --attach --name bridge",
"setup-files": "node scripts/setup-files.js",
"start": "node ."
},
Expand All @@ -21,6 +21,7 @@
"dotenv": "^16.4.5",
"mineflayer": "^4.20.1",
"obscenity": "^0.1.4",
"pm2": "^5.4.2",
"prismarine-chat": "^1.10.1",
"zod": "^3.23.8"
},
Expand Down
Loading

0 comments on commit 3572737

Please sign in to comment.