Skip to content

Commit 108e971

Browse files
committed
readme: clarify development
1 parent 764db8c commit 108e971

1 file changed

Lines changed: 38 additions & 13 deletions

File tree

README.md

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,56 @@
1-
# hackbot
1+
# Hackbot :robot:
22

3-
See `.env.sample` for a list of environment variables that should be set.
3+
## Development
44

5-
# Running hackbot locally
5+
First, install all the required dependencies with `npm install`.
66

7-
First, run `npm install` to install all the required dependencies.
7+
```bash
8+
npm install
9+
```
10+
11+
Then, see `.env.sample` for a list of environment variables that should be
12+
set.
13+
14+
```bash
15+
cp .env.sample .env
16+
```
17+
18+
By default, hackbot will run with all the plugins in the `scripts/`
19+
directory. If you only want to test one plugin, move all but your script to
20+
`disabled_scripts/`.
821

9-
Test hackbot by running `npm run dev`. However, some plugins
10-
will not behave as expected unless you set the
11-
[environment variables](#configuration).
22+
```bash
23+
mv scripts/* disabled_scripts/
24+
mv disabled_scripts/my_plugin.js scripts/
25+
```
1226

13-
You'll see some start up output and a prompt:
27+
If your plugin requires environment variables, be sure to put them in `.env`.
1428

29+
```bash
30+
vi .env
31+
source .env
1532
```
33+
34+
Finally, run hackbot locally with `npm run dev`. You will see some logging
35+
info and a message prompt.
36+
37+
```bash
38+
$ npm run dev
1639
[Set Jul 22 2017 23:16:06 GMT-0400 (EDT)] INFO Using default redis on localhost:6379
1740
hackbot>
1841
```
1942

20-
Then you can interact with hackbot by typing `hackbot help` or any
21-
other supported command.
43+
Now you can interact with hackbot by typing `hackbot help` or any other
44+
supported command.
2245

23-
```
46+
```bash
47+
$ npm run dev
48+
[Set Jul 22 2017 23:16:06 GMT-0400 (EDT)] INFO Using default redis on localhost:6379
2449
hackbot> hackbot ping
2550
hackbot> PONG
2651
```
2752

28-
# Configuration
53+
## Configuration
2954

3055
Most of the scripts in `scripts/` use [hubot-conf][hubot-conf]
3156
to access configuration values from the HackMIT Slack. That means
@@ -49,7 +74,7 @@ values for the scripts you're changing.
4974
Remember to `source .env` and restart hackbot with `npm run dev`
5075
after you make a change!
5176

52-
# Examples
77+
## Examples
5378

5479
You can see some more example scripts [here][examples].
5580

0 commit comments

Comments
 (0)