no_build=false
start_from=""
-do_continue=false
-while getopts 'cns:' opt; do
+while getopts 'ns:' opt; do
case "$opt" in
- c)
- do_continue=true
- ;;
-
n)
no_build=true
;;
fi
}
-if $do_continue; then
+if [ -f "$SHA1_FILE" ]; then
last=$(tail -n1 "$SHA1_FILE" | cut -f1 -d"$_TAB")
start_from=$(get_branches | sed -n '/^'"$last"'$/{n;p;}')
+ if [ -z "$start_from" ]; then
+ printf '%s: %s exists but cannot find next tree\n' "$0" "$SHA1_FILE" 1>&2
+ exit 1
+ fi
fi
if [ -z "$start_from" ]; then
cp /dev/null "$LOG_FILE"