Skip to content

Instantly share code, notes, and snippets.

@alcir-junior-caju
Created February 17, 2019 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alcir-junior-caju/d358bfa4883dc2cf2ec660b47d32948c to your computer and use it in GitHub Desktop.
Save alcir-junior-caju/d358bfa4883dc2cf2ec660b47d32948c to your computer and use it in GitHub Desktop.
Script Install Themosis
#!/bin/bash
# Params
dir=${1} # Name Project Dir
version=${2} # Version Themosis 2.0-beta3
# Change your Params
user='root'
pass='root'
db='mysql'
app='http:\/\/dev.wordpress.'${dir,,}
wp='http:\/\/dev.wordpress.'${dir,,}'\/cms'
lang='pt_BR'
locale="env('LOCALE', '"${lang}"')"
# Install Themosis
composer create-project themosis/themosis ${dir} ${version}
# Access Dir
cd ${dir}
# Install Theme
php console theme:install ${dir,,}
# Set .env
sed -i -e "s/\(DATABASE_NAME = \).*/\1\"${dir,,}\"/" \
-e "s/\(DATABASE_USER = \).*/\1\"${user}\"/" \
-e "s/\(DATABASE_PASSWORD = \).*/\1\"${pass}\"/" \
-e "s/\(DATABASE_HOST = \).*/\1\"${db}\"/" \
-e "s/\(APP_URL = \).*/\1\"${app}\"/" \
-e "s/\(WP_URL = \).*/\1\"${wp}\"/" .env
# Add Locale .env
sed -i -e "s/\('locale' => \).*/\1${locale}/" ./config/app.php
sed -i "1i LOCALE = \"${lang}\"" .env
# Force Display Languages Install
sed -i "94i\/\/ Force display languages" ./htdocs/cms/wp-settings.php
sed -i "95i\define('FS_METHOD', 'direct');" ./htdocs/cms/wp-settings.php
# Permission (Optional)
cd ..
chmod -R 777 ${dir}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment