Skip to content

Commit fdf6d21

Browse files
committed
Removed OS X related if-else's
1 parent ed61291 commit fdf6d21

File tree

1 file changed

+25
-35
lines changed

1 file changed

+25
-35
lines changed

scripts/install.sh

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@ set -e
44

55
PACKAGENAME=builder
66

7-
if [[ "$OSTYPE" == "linux-gnu" ]]; then
8-
echo "Configuring environment for Linux"
9-
# Make sure we have up-to-date stuff
10-
sudo apt-get update
11-
if [[ ! $TRAVIS ]]; then
12-
# Ubuntu Server (on AWS?) lacks UTF-8 for some reason. Give it that
13-
sudo locale-gen en_US.UTF-8
14-
sudo apt-get install -y php5-intl
15-
fi
16-
# Install dependencies
17-
sudo apt-get install -y apache2 libapache2-mod-php5 php-pear php5-curl php5-sqlite php5-mysql acl curl git
18-
# Enable Apache configs
19-
sudo a2enmod rewrite
20-
sudo a2enmod alias
21-
# Restart Apache
22-
sudo service apache2 restart
23-
elif [[ "$OSTYPE" == "darwin"* ]]; then
24-
# is there something comparable to this on os x? perhaps Homebrew
25-
echo "Configuring environment for OS X (to be added..)"
7+
if [[ "$OSTYPE" != "linux-gnu" ]]; then
8+
echo "Only Linux environment is supported"
269
fi
10+
echo "Configuring environment for Linux"
11+
# Make sure we have up-to-date stuff
12+
sudo apt-get update
13+
if [[ ! $TRAVIS ]]; then
14+
# Ubuntu Server (on AWS?) lacks UTF-8 for some reason. Give it that
15+
sudo locale-gen en_US.UTF-8
16+
sudo apt-get install -y php5-intl
17+
fi
18+
# Install dependencies
19+
sudo apt-get install -y apache2 libapache2-mod-php5 php-pear php5-curl php5-sqlite php5-mysql acl curl git
20+
# Enable Apache configs
21+
sudo a2enmod rewrite
22+
sudo a2enmod alias
23+
# Restart Apache
24+
sudo service apache2 restart
25+
2726

2827
if [[ ! $TRAVIS ]]; then
2928

@@ -47,23 +46,14 @@ cd /opt/codebender/$PACKAGENAME
4746
rm -rf Symfony/app/cache/*
4847
rm -rf Symfony/app/logs/*
4948

50-
if [[ "$OSTYPE" == "linux-gnu" ]]; then
51-
52-
if [[ ! $TRAVIS ]]; then
53-
# Need to create cache and logs directories, as they do not pre-exist in new deployments
54-
mkdir -p `pwd`/Symfony/app/cache/
55-
mkdir -p `pwd`/Symfony/app/logs/
56-
57-
# Set access control for both apache and current user on cache and logs directories
58-
sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs
59-
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs
60-
fi
61-
62-
elif [[ "$OSTYPE" == "darwin"* ]]; then
49+
if [[ ! $TRAVIS ]]; then
50+
# Need to create cache and logs directories, as they do not pre-exist in new deployments
51+
mkdir -p `pwd`/Symfony/app/cache/
52+
mkdir -p `pwd`/Symfony/app/logs/
6353

64-
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
65-
sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" Symfony/app/cache Symfony/app/logs
66-
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" Symfony/app/cache Symfony/app/logs
54+
# Set access control for both apache and current user on cache and logs directories
55+
sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs
56+
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs
6757
fi
6858

6959
cd Symfony

0 commit comments

Comments
 (0)