forked from andreyvit/yoursway-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunbuilder
executable file
·46 lines (39 loc) · 1.09 KB
/
runbuilder
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
45
46
#! /bin/sh
# defaults
selfupdate=false
git=git
name=""
# read user config
test -f ~/.ysbuilder_conf && source ~/.ysbuilder_conf
# parse command-line options
test "$1" == "-U" && selfupdate=true
# apply config file settings
export BUILDER_SELFUPDATE="$selfupdate"
export BUILDER_NAME="$name"
export PATH
if $selfupdate && ! $git --version >/dev/null; then
echo
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "Could not locate Git. If it is installed, please specify its path"
echo "in ~/.ysbuilder_conf, e.g.:"
echo " git=/usr/local/bin/git"
echo
echo "Alternatively, you can explicitly specify the correct PATH, e.g.:"
echo " PATH=/bin:/usr/bin:/usr/local/bin:~/bin"
echo
echo "For your reference, the current value of \$PATH is:"
echo " $PATH"
echo
echo "Automatic updates will be disabled until you resolve this issue."
echo
selfupdate=false
fi
cd "$(dirname "$0")"
mydir="$(pwd)"
${RUBY-ruby} "$mydir/client/worker.rb" "$@"
if $selfupdate; then
$git fetch
$git stash
$git reset --hard origin/master
fi
exec "$mydir/$(basename "$0")" "$@"