You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feel free to [fork](https://help.github.com/articles/fork-a-repo) this repository and [create a pull request](https://help.github.com/articles/creating-a-pull-request). Before making a large change, please open an issue to discuss it.
6
+
7
+
Make descriptive, granular commits. No need to squash them for the pull request.
8
+
9
+
If you drift too far from the master branch, please [merge](https://help.github.com/articles/syncing-a-fork) rather than rebasing. This will preserve the commit history that shows the context in which the code was written.
10
+
11
+
## style
12
+
13
+
- Tabs for indenting. Spaces for alignment.
14
+
- Wrap discrete chunks of code in functions. This makes writing tests easier.
15
+
- See [.editorconfig](.editorconfig) for more specifics and exceptions.
16
+
- Follow the style you see in the code that's already here.
17
+
18
+
## testing
19
+
20
+
Have [bats](https://github.com/sstephenson/bats#readme) installed.
21
+
22
+
Groups of tests are in `.bats` files in the repository root. You can [run tests manually](https://github.com/sstephenson/bats#running-tests) or use the `./watch` script (requires [`entr`](https://github.com/clibs/entr)) to automatically run them when any file is changed.
23
+
24
+
Discrete chunks of code should have a discrete set of tests. If possible, tests should call the relevant function rather than running the whole script.
25
+
26
+
Write tests like [executable specifications](https://youtu.be/XcT4yYu_TTs?t=17m20s).
27
+
28
+
Group together tests that share a common subject by indenting test names with spaces, to achieve output similar to [Mocha](http://mochajs.org/#spec) or [RSpec](http://rspec.info/#asciicast-iframe-14103).
29
+
30
+
For anything that involves touching the file system, use `setup()` & `teardown()` functions to create a temporary directory:
31
+
32
+
```bash
33
+
setup() {
34
+
run mktemp -dt deploy_test.XXXX
35
+
assert_success
36
+
tmp=$output
37
+
pushd"$tmp">/dev/null
38
+
}
39
+
```
40
+
41
+
```bash
42
+
teardown() {
43
+
popd>/dev/null
44
+
rm -rf "$tmp"
45
+
}
46
+
```
47
+
48
+
Finally, make sure the `.bats` files are in a path that's accounted-for in [`circle.yml`](circle.yml).
For an example of use, see [X1011/verge-mobile-bingo](https://github.com/X1011/verge-mobile-bingo).
5
+
For an example of use, see [X1011/verge-mobile-bingo](https://github.com/X1011/verge-mobile-bingo). For development info, see [contributing.md](contributing.md).
6
6
7
7
## configuration
8
8
Download the script (`wget https://github.com/X1011/git-directory-deploy/raw/master/deploy.sh && chmod +x deploy.sh`) and edit these variables within it as needed to fit your project:
0 commit comments