Skip to content

Instantly share code, notes, and snippets.

@revooms
Last active January 14, 2020 11:41
Show Gist options
  • Save revooms/d706ed66274d4ed7d028f7c72c323353 to your computer and use it in GitHub Desktop.
Save revooms/d706ed66274d4ed7d028f7c72c323353 to your computer and use it in GitHub Desktop.
Bash scripts

Bash scripts

Place the files inside a folder in your %PATH%, e.g. ~/bin.

The scripts use ts for timestamping. If ts is not installed on your system please install the package moreutils

Installation

cd to an appropriate folder where you want the scripts to be installed, i.e. cd ~/bin. Run

git clone git@gist.github.com:d706ed66274d4ed7d028f7c72c323353.git gists

to install all scripts in a folder gists in that folder. Make sure ~/bin/gists/ is in your PATH

#!/usr/bin/env bash
composer.phar $@
#!/usr/bin/env bash
echo "*** Starting Fresh Migration With Seeding" | ts '[%Y-%m-%d %H:%M:%S]'
source .env
php artisan migrate:fresh --seed
#!/usr/bin/env bash
clear
echo "*** Starting Laravel Initialization" | ts '[%Y-%m-%d %H:%M:%S]'
composer install
npm install
cp .env.example .env
php artisan key:generate
touch storage/database.sqlite
chmod -R a+w storage/
chmod -R a+w bootstrap/
#!/usr/bin/env bash
clear
echo "*** Compiling assets" | ts '[%Y-%m-%d %H:%M:%S]'
npm run production
#!/usr/bin/env bash
clear
echo "*** Compiling assets" | ts '[%Y-%m-%d %H:%M:%S]'
npm run watch
#!/usr/bin/env bash
clear
echo "*** Starting PHPUnit" | ts '[%Y-%m-%d %H:%M:%S]'
vendor/bin/phpunit
#!/usr/bin/env bash
echo "*** Starting PHP server" | ts '[%Y-%m-%d %H:%M:%S]'
php artisan serve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment