#!/bin/bash

git reset --hard
git pull

base=${PWD}/../

[ -d "${base}storage/app" ] && rm -rf storage/app && ln -s ${base}storage/app ./storage/app

chmod -R 777 storage
chmod -R 777 bootstrap
chmod -R 777 bootstrap/cache
find storage -type d -exec chmod 777 {} \;

sh ./optimize
