comparison scripts/.bela_common @ 447:86591d203c78 prerelease

Updated scripts to use "." instead of source, for sh compatibility
author Giulio Moro <giuliomoro@yahoo.it>
date Sun, 19 Jun 2016 16:33:05 +0100
parents 2b09be3fb0f2
children 03b511d99f3d
comparison
equal deleted inserted replaced
446:566bb80c2d14 447:86591d203c78
9 [ -z "$BBB_DEFAULT_PROJECT_NAME" ] && BBB_DEFAULT_PROJECT_NAME="scriptUploadedProject" 9 [ -z "$BBB_DEFAULT_PROJECT_NAME" ] && BBB_DEFAULT_PROJECT_NAME="scriptUploadedProject"
10 [ -z "$BBB_PROJECT_NAME" ] && BBB_PROJECT_NAME=$BBB_DEFAULT_PROJECT_NAME 10 [ -z "$BBB_PROJECT_NAME" ] && BBB_PROJECT_NAME=$BBB_DEFAULT_PROJECT_NAME
11 11
12 trap "echo; exit 0;" 2 9 12 trap "echo; exit 0;" 2 9
13 folder_has_changed(){ 13 folder_has_changed(){
14 [ -z "$2" ] && { echo "Error: folder_has_changed(folder, reference, [filter])"; exit 1; } 14 [ -z "$2" ] && { echo "Error: folder_has_changed(folder, reference, [filter])"; return 1; }
15 [ -z "$3" ] && FILTER="." || FILTER="$3" 15 [ -z "$3" ] && FILTER="." || FILTER="$3"
16 find "$1" -type f -newer "$2" | grep "$FILTER" 16 find "$1" -type f -newer "$2" | grep "$FILTER"
17 return $? 17 return $?
18 } 18 }
19 19
20 wait_for_change(){ 20 wait_for_change(){
21 [ -z "$2" ] && { echo "Error: folder_has_changed(folder, reference, [filter])"; exit 1; } 21 [ -z "$2" ] && { echo "Error: folder_has_changed(folder, reference, [filter])"; return 1; }
22 [ -z "$4" ] && SLEEP=0.5 || SLEEP="$4" 22 [ -z "$4" ] && SLEEP=0.5 || SLEEP="$4"
23 while ! folder_has_changed "$1" "$2" "$3" 23 while ! folder_has_changed "$1" "$2" "$3"
24 do 24 do
25 sleep $SLEEP; 25 sleep $SLEEP;
26 done 26 done