Skip to content

Commit

Permalink
Merge pull request #10 from tightenco/customize-editor
Browse files Browse the repository at this point in the history
Add a parameter for customizing the editor
  • Loading branch information
mattstauffer authored Jul 25, 2016
2 parents 7fbcaa0 + 6d11ccd commit df3b865
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lambo
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Creating new Laravel app $PROJECTNAME
PROJECTNAME=$1
PROJECTPATH="."
MESSAGE="Initial commit."
EDITOR=""

while [[ $# -gt 1 ]]
do
Expand All @@ -49,6 +50,10 @@ do
MESSAGE="$2"
shift
;;
-e|--editor)
EDITOR="$2"
shift
;;
*)
;;
esac
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit df3b865

Please sign in to comment.