diff --git a/lambo b/lambo index a886e9d3..63fdf38b 100755 --- a/lambo +++ b/lambo @@ -35,6 +35,7 @@ Creating new Laravel app $PROJECTNAME PROJECTNAME=$1 PROJECTPATH="." MESSAGE="Initial commit." +EDITOR="" while [[ $# -gt 1 ]] do @@ -49,6 +50,10 @@ do MESSAGE="$2" shift ;; + -e|--editor) + EDITOR="$2" + shift + ;; *) ;; esac @@ -63,6 +68,11 @@ git init git add . git commit -m "$MESSAGE" +if [ "$EDITOR" != "" ] +then + eval "$EDITOR ." +fi + # Update .env to point to this database with `root` username and blank pw, # like Mac MySQL defaults sed -i '' "/DB_DATABASE/s/homestead/$PROJECTNAME/" .env diff --git a/readme.md b/readme.md index 13bf237f..6b3ad50a 100644 --- a/readme.md +++ b/readme.md @@ -51,6 +51,13 @@ This will `laravel new superApplication`, change into that directory, make an in lambo superApplication -m "This lambo runs fast!" ``` +- `-e` or `--editor` to define your editor command. Whatever is passed here will be run as `$EDITOR .` after creating the project. + + ```bash + # runs "subl ." in the project directory after creating the project + lambo superApplication -e subl + ``` + ## Requirements - Mac-only.