Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
vagrant: Simplify scripts/vagrant-setup.sh
Browse files Browse the repository at this point in the history
Windows Git doesn't mess with newlines by default anymore, so remove
that warning. Modify `/etc/profile.d` with sudo, demystify PostreSQL
command line.
  • Loading branch information
techtonik committed Nov 17, 2014
1 parent 168aa32 commit 81d650f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
14 changes: 0 additions & 14 deletions scripts/crlf-warning.txt

This file was deleted.

19 changes: 3 additions & 16 deletions scripts/vagrant-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,13 @@
set -e

# Set login directory to root vagrant share
echo "cd /vagrant" > /etc/profile.d/login-directory.sh
sudo sh -c "echo 'cd /vagrant' > /etc/profile.d/login-directory.sh"

# Configure Postgres
# Configure Postgres (using system user 'postgres' run command
# 'psql' with PostreSQL user 'postgres` to quietly execute scripts)
sudo -u postgres psql -U postgres -qf /vagrant/scripts/create_db.sql
sudo -u postgres psql -U postgres -qf /vagrant/scripts/create_test_db.sql

cd /vagrant

# Warn if Windows newlines are detected and try to fix the problem
if grep --quiet --binary --binary-files=without-match $(printf '\r') README.md; then
echo
cat scripts/crlf-warning.txt
echo

echo 'Running "git config core.autocrlf false"'
git config core.autocrlf false

exit 1
fi

# Set up the environment, the database, and run Gratipay
cd /vagrant && make clean env schema data

Expand Down

0 comments on commit 81d650f

Please sign in to comment.