This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
slim/bin/install.bash

70 lines
2.2 KiB
Bash
Raw Normal View History

2023-02-21 00:27:50 -08:00
#!/bin/bash
# check that $1 folder does not exit
[ -d "$1" ] && echo "Folder $1 already exists" && exit 1
2023-03-09 16:42:07 -08:00
echo "*** Starting New Slim Project ***"
2023-02-21 00:27:50 -08:00
################################################################################
# Check composer installed
################################################################################
composer -v > /dev/null 2>&1
COMPOSER=$?
if [[ $COMPOSER -ne 0 ]]; then
echo 'Composer is not installed'
echo 'Checkout how to Install Composer here: https://www.nickyeoman.com/blog/php/install-composer-on-ubuntu/'
echo 'Once installed, try running this script again'
exit 1
fi
2023-03-09 16:42:07 -08:00
mkdir $1
2023-02-21 00:27:50 -08:00
cd $1
################################################################################
# Create directories
################################################################################
2023-03-09 16:42:07 -08:00
mkdir sass templates
2023-02-21 00:27:50 -08:00
mkdir -p public/css
2023-03-09 16:42:07 -08:00
# TODO: public index.php file
2023-02-21 00:27:50 -08:00
################################################################################
# Composer
################################################################################
2023-03-09 16:42:07 -08:00
composer require slim/slim:"4.*"
composer require slim/psr7
composer require slim/twig-view
composer require nickyeoman/nytwig
composer require nickyeoman/sassLibrary
################################################################################
# Docker
################################################################################
echo "Creating a docker-compose"
wget https://raw.githubusercontent.com/nickyeoman/phpframework/main/docker/docker-compose.yml
echo "Creating a Dockerfile"
wget https://raw.githubusercontent.com/nickyeoman/phpframework/main/docker/Dockerfile
2023-02-21 00:27:50 -08:00
2023-03-09 16:42:07 -08:00
wget -O .env https://raw.githubusercontent.com/nickyeoman/phpframework/main/env.sample
2023-02-21 00:27:50 -08:00
################################################################################
# Git
################################################################################
git init
2023-03-09 16:42:07 -08:00
#echo '.sass-cache/' >> .gitignore
2023-02-21 00:27:50 -08:00
git add .
git commit -m"First Commit, slim installed"
################################################################################
# Clean up
################################################################################
echo '***********************************'
echo ''
echo 'done'