Skip to content

Commit

Permalink
Merge pull request #83 from TedDriggs/devtools
Browse files Browse the repository at this point in the history
Added macOS support for pre-push tests
  • Loading branch information
colin-kiegel authored Apr 18, 2017
2 parents e48b24d + 6982e11 commit af5bd0d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion dev/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# DEV Tools

It's very useful to set `dev/githook.sh` as a `pre-push` hook, like this:
It's very useful to set `dev/githook.sh` as a `pre-push` hook.

On Linux, do this:

```bash
(cd .git/hooks && ln -s ../../dev/githook.sh pre-push)
```

As macOS doesn't support symlinks in `readlink`, do this:

```bash
(cd .git/hooks && echo $'#!/bin/bash
dev/githook.sh' > pre-push)
```

This will basically do all the tests that travis would do, before the push is
executed.

Expand Down
2 changes: 1 addition & 1 deletion dev/checkfeatures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function main {
}

function base_dir {
if hash readlink 2>/dev/null; then
if [ uname -s != "Darwin" ] -a hash readlink 2>/dev/null; then
# use readlink, if installed, to follow symlinks
local __DIR="$(dirname "$(readlink -f "$0")")"
else
Expand Down
2 changes: 1 addition & 1 deletion dev/githook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function check_or_echo {
}

function base_dir {
if hash readlink 2>/dev/null; then
if [ uname -s != "Darwin" ] -a hash readlink 2>/dev/null; then
# use readlink, if installed, to follow symlinks
local __DIR="$(dirname "$(readlink -f "$0")")"
else
Expand Down
2 changes: 1 addition & 1 deletion dev/nightlytests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function main {
}

function base_dir {
if hash readlink 2>/dev/null; then
if [ uname -s != "Darwin" ] -a hash readlink 2>/dev/null; then
# use readlink, if installed, to follow symlinks
local __DIR="$(dirname "$(readlink -f "$0")")"
else
Expand Down
2 changes: 1 addition & 1 deletion dev/stylechecks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function main {
}

function base_dir {
if hash readlink 2>/dev/null; then
if [ uname -s != "Darwin" ] -a hash readlink 2>/dev/null; then
# use readlink, if installed, to follow symlinks
local __DIR="$(dirname "$(readlink -f "$0")")"
else
Expand Down

0 comments on commit af5bd0d

Please sign in to comment.