Don't break setup when no sudo

This commit is contained in:
Marcin Kulik 2015-07-18 11:47:48 +00:00
parent 440cc1cb21
commit f8d28b4b7c

View File

@ -2,9 +2,8 @@
set -e set -e
sudo apt-get install -y autoconf libtool pkg-config if sudo apt-get install -y autoconf libtool pkg-config; then
if [ ! -e /usr/local/lib/libtsm.a ]; then
if [ ! -e /usr/local/lib/libtsm.a ]; then
echo "libtsm missing, compiling from source..." echo "libtsm missing, compiling from source..."
DIR=$(mktemp -d -t tsmXXXXXX) DIR=$(mktemp -d -t tsmXXXXXX)
cd $DIR cd $DIR
@ -16,16 +15,19 @@ if [ ! -e /usr/local/lib/libtsm.a ]; then
sudo make install sudo make install
sudo ldconfig sudo ldconfig
cd - cd -
fi
if [ -e /usr/local/lib/libtsm.a ]; then
cd src && make && cd -
fi
else
echo "warning: sudo failed, not compiling libtsm and terminal binary"
fi fi
if [ ! -e config/database.yml ]; then if [ ! -e config/database.yml ]; then
cp config/database.yml.example config/database.yml cp config/database.yml.example config/database.yml
fi fi
if [ -e /usr/local/lib/libtsm.a ]; then
cd src && make && cd -
fi
rm -f log/* rm -f log/*
bundle install bundle install
bundle exec rake db:setup bundle exec rake db:setup