Skip to content

Commit 2d5bf0e

Browse files
committed
WAT-001 Travis integration
1 parent 6e946e0 commit 2d5bf0e

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

.travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
###
2+
### Sudo required
3+
###
4+
sudo: required
5+
6+
7+
###
8+
### Set language
9+
###
10+
language: bash
11+
12+
13+
###
14+
### Install required software
15+
###
16+
before_install:
17+
- sudo apt-get update
18+
- sudo apt-get install -y shellcheck
19+
20+
21+
###
22+
### Run tests
23+
###
24+
script:
25+
- shellcheck --shell=bash watcherd

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# watcherd
22

3+
[![Build Status](https://travis-ci.org/devilbox/watcherd.svg?branch=master)](https://travis-ci.org/devilbox/watcherd)
4+
35
watcherd will look for directory changes (added and deleted directories) under the specified path (`-p`) and will execute specified commands or shell scripts (`-a`, `-d`) depending on the event.
46
Once all events have happened during one round (`-i`), a trigger command can be executed (`-t`).
57
Note, the trigger command will only be execute when at least one add or delete command has succeeded with exit code 0.
@@ -34,10 +36,10 @@ Required arguments:
3436
-p <path> Path to directoy to watch for changes.
3537
-a <cmd> Command to execute when a directory was added.
3638
The full path of the new dir will be appended as an argument to
37-
this command.
39+
this command.
3840
-d <cmd> Command to execute when a directory was deletd.
3941
The full path of the new dir will be appended as an argument to
40-
this command.
42+
this command.
4143

4244
Optional arguments:
4345
-t <cmd> Command to execute after all directories have been added or

watcherd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ if [ "${WATCHER}" = "inotify" ]; then
278278
--event delete \
279279
--event move \
280280
--format '%e/\\%w%f' \
281-
"${WATCH_DIR}" | while read output; do
281+
"${WATCH_DIR}" | while read -r output; do
282282
d="${output##*\\}"
283283
if [[ "${output}" =~ ^(CREATE|MOVED_TO),ISDIR/\\ ]]; then
284284
if action "${d}" "${CMD_ADD}" "ADD" "${VERBOSE}"; then
@@ -334,6 +334,6 @@ else
334334
ALL_DIRS="${NEW_DIRS}"
335335

336336
# Wait before restarting loop
337-
sleep ${INTERVAL}
337+
sleep "${INTERVAL}"
338338
done
339339
fi

0 commit comments

Comments
 (0)