Skip to content

Instantly share code, notes, and snippets.

@andrew-smart
Created February 18, 2016 14:55
Show Gist options
  • Select an option

  • Save andrew-smart/7f71598a69df9ff41f55 to your computer and use it in GitHub Desktop.

Select an option

Save andrew-smart/7f71598a69df9ff41f55 to your computer and use it in GitHub Desktop.
Create a new project in Magento 2
#!/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'
@gazjoy

gazjoy commented Feb 18, 2016

Copy link
Copy Markdown

Nice work Mr.S. Is this a copy and paste into command line job?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment