Changes
Jump to navigation
Jump to search
→script cleanup: new section
See also [[ConTeXt Minimals/Implementation]].
== script cleanup ==
line 5 in first-setup.sh tells me:
<pre># feel free to suggest a more elegant solution</pre>
so i do.
<pre>if which rsync &> /dev/null; then
echo "OK" > /dev/null
else
echo "You need to install rsync first."
exit
fi
</pre>
can be replaced with
<pre>
if [ ! -x "`which rsync`" ]; then
echo "You need to install rsync first."
exit 1
fi
</pre>
or (as there is another such test below):
<pre>
check_and_complain () {
if [ ! -x "`which $1`" ]; then
echo "You need to install $1 first."
exit 1
fi
}
check_and_complain rsync
check_and_complain ruby
</pre>