Skip to content

Instantly share code, notes, and snippets.

@Raphhh
Last active August 29, 2015 14:06
Show Gist options
  • Save Raphhh/d45795a6121d0e875619 to your computer and use it in GitHub Desktop.
Save Raphhh/d45795a6121d0e875619 to your computer and use it in GitHub Desktop.
PHP Lib Bootstrap script
#!/bin/sh
working_directory='./'
bootstrap_name='raphhh/php-lib-bootstrap'
bootstrap_version='@stable'
echo 'PHP Lib Bootstrap Generator'
echo '';
echo 'Enter your project name (<vendor>/<name>):'
read project_name
echo '';
echo 'Process to installation'
composer self-update
composer create-project $bootstrap_name $working_directory$project_name $bootstrap_version
echo '';
echo 'Test installation'
cd $project_name
./vendor/bin/phpunit
echo '';
echo 'Enter your GitHub user:'
read github_user
echo '';
echo 'Enter your GitHub repository to create:'
read github_repository
echo '';
echo "Creation of $github_user/$github_repository";
curl -u $github_user https://api.github.com/user/repos -d "{\"name\":\"$github_repository\"}"
git init
git remote add origin https://github.com/$github_user/$github_repository.git
git remote -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment