Created
February 18, 2016 14:55
-
-
Save andrew-smart/7f71598a69df9ff41f55 to your computer and use it in GitHub Desktop.
Create a new project in Magento 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| name=$1 | |
| if [ -z "$name" ]; then | |
| echo "\$name required" | |
| exit 1 | |
| fi | |
| path=$(eval echo "~/Sites/$name") | |
| if [ -d "$path" ]; then | |
| echo "$path already exists. Aborting" | |
| exit 1 | |
| fi | |
| mkdir "$path" && cd "$path" | |
| composer create-project \ | |
| --no-install \ | |
| --repository-url=https://repo.magento.com/ \ | |
| magento/project-community-edition \ | |
| public_html | |
| cd "$path/public_html" | |
| composer install | |
| git init && git add . && git commit -m 'Initial commit' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice work Mr.S. Is this a copy and paste into command line job?