Skip to content

Commit

Permalink
Added scripts folder
Browse files Browse the repository at this point in the history
Added `scripts` folder for a standard interface to perform common tasks
  • Loading branch information
bhelx committed Aug 24, 2018
1 parent 2ad345b commit a74c899
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -e

composer install --dev
13 changes: 13 additions & 0 deletions scripts/check-deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e

function check_for_command {
if ! hash eval "$1" 2>/dev/null; then
echo "✖ Could not find '$1'"
exit 1
fi
echo "✓ Found $1"
}

check_for_command "php"
check_for_command "composer"
23 changes: 23 additions & 0 deletions scripts/install-deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e

if ! hash brew 2>/dev/null; then
echo "✖ Homebrew not found. Please install: https://brew.sh/"
exit 1
else
echo "✓ Found homebrew"
fi

if ! hash composer 2>/dev/null; then
read -p "✖ 'composer' not found. Would you like to install it? [Y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
curl -s https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
else
exit 1
fi
else
echo "✓ Found composer"
fi
4 changes: 4 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -e

./vendor/bin/phpunit

0 comments on commit a74c899

Please sign in to comment.