Skip to content

Commit ac40135

Browse files
authored
feat: add eggctl bin (#10)
1 parent e207052 commit ac40135

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ $ npm i egg-scripts --save
1212

1313
## Usage
1414

15-
Add `egg-scripts` to `package.json` scripts:
15+
Add `eggctl` to `package.json` scripts:
1616

1717
```json
1818
{
1919
"scripts": {
20-
"start": "egg-scripts start --daemon",
21-
"stop": "egg-scripts stop"
20+
"start": "eggctl start --daemon",
21+
"stop": "eggctl stop"
2222
}
2323
}
2424
```
@@ -36,10 +36,10 @@ Then run as:
3636
Start egg at prod mode.
3737

3838
```bash
39-
$ egg-scripts start [options] [baseDir]
39+
$ eggctl start [options] [baseDir]
4040
# Usage
41-
# egg-scripts start --port=7001
42-
# egg-scripts start ./server
41+
# eggctl start --port=7001
42+
# eggctl start ./server
4343
```
4444

4545
- **Arguments**
@@ -50,16 +50,19 @@ $ egg-scripts start [options] [baseDir]
5050
- `workers` - numbers of app workers, default to `process.env.EGG_WORKERS`, if unset, egg will use `os.cpus().length` as default.
5151
- `daemon` - whether run at background daemon mode.
5252
- `framework` - specify framework that can be absolute path or npm package, default to auto detect.
53-
- `env` - egg server env, default to `process.env.EGG_SERVER_ENV`, recommended to keep empty then use framwork default env.
53+
- `env` - server env, default to `process.env.EGG_SERVER_ENV`, recommended to keep empty then use framwork default env.
54+
- `stdout` - customize stdout file, default to `$HOME/logs/master-stdout.log`.
55+
- `stderr` - customize stderr file, default to `$HOME/logs/master-stderr.log`.
56+
- `timeout` - the maximum timeout when app starts, default to 300s.
5457

5558
### stop
5659

5760
Stop egg gracefull.
5861

5962
```bash
6063
# stop egg
61-
$ egg-scripts stop [baseDir]
62-
# egg-scripts stop ./server
64+
$ eggctl stop [baseDir]
65+
# eggctl stop ./server
6366
```
6467

6568
- **Arguments**

lib/cmd/start.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ class StartCommand extends Command {
4747
type: 'boolean',
4848
},
4949
stdout: {
50-
description: 'A file that stdout redirect to',
50+
description: 'customize stdout file',
5151
type: 'string',
5252
},
5353
stderr: {
54-
description: 'A file that stderr redirect to',
54+
description: 'customize stderr file',
5555
type: 'string',
5656
},
5757
timeout: {
58-
description: 'a timeout for start when daemon',
58+
description: 'the maximum timeout when app starts',
5959
type: 'number',
6060
default: 300 * 1000,
6161
},

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "deploy tool for egg project",
55
"main": "index.js",
66
"bin": {
7-
"egg-scripts": "bin/egg-scripts.js"
7+
"egg-scripts": "bin/egg-scripts.js",
8+
"eggctl": "bin/egg-scripts.js"
89
},
910
"dependencies": {
1011
"common-bin": "^2.7.1",

0 commit comments

Comments
 (0)