-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·44 lines (36 loc) · 701 Bytes
/
run
File metadata and controls
executable file
·44 lines (36 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
script_dir=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
filter=""
dry="0"
while [[ $# > 0 ]]; do
if [[ $1 == "--dry" ]]; then
dry="1"
else
filter="$1"
fi
shift
done
log() {
if [[ $dry == "1" ]]; then
echo "[DRY_RUN]: $@"
else
echo "$@"
fi
}
execute(){
log "execute $@"
if [[ $dry == "1" ]]; then
return
fi
"$@"
}
log "$script_dir -- $filter"
cd $script_dir
scripts=$(find ./runs -maxdepth 1 -mindepth 1 -executable -type f )
for script in $scripts ; do
if echo "$script" | grep -qv "$filter"; then
log "filtering $script "
continue
fi
execute ./$script
done