Skip to content

Commit

Permalink
Merge pull request #23 from milose/yarn
Browse files Browse the repository at this point in the history
Run `npm install` or `yarn` on the project.
  • Loading branch information
mattstauffer authored Nov 10, 2016
2 parents f51412b + 86e6b3f commit e7e84b2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lambo
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ showhelp()
echo "${green} -p, --path PATH${reset} Customize the path in which the new project will be created"
echo "${green} -d, --dev${reset} Use Composer to install on the develop branch"
echo "${green} -a, --auth${reset} Use Artisan to scaffold all of the routes and views you need for authentication"
echo "${green} -n, --node${reset} Runs '${green}yarn${reset}' if installed, otherwise runs '${green}npm install${reset}' after creating the project"
quit
}

Expand Down Expand Up @@ -53,6 +54,7 @@ PROJECTPATH="."
MESSAGE="Initial commit."
DEVELOP=false
AUTH=false
NODE=false
EDITOR=""
TLD=$(php -r "echo json_decode(file_get_contents('$HOME/.valet/config.json'))->domain;")

Expand Down Expand Up @@ -89,6 +91,9 @@ do
-a|--auth)
AUTH=true
;;
-n|--node)
NODE=true
;;
*)
;;
esac
Expand All @@ -110,10 +115,23 @@ else
laravel new $PROJECTNAME
fi
cd "$PROJECTNAME"

if [ "$NODE" = true ]
then
# check if yarn is executable, otherwise use npm
if hash yarn 2>/dev/null
then
yarn
else
npm install
fi
fi

if [ "$AUTH" = true ]
then
php artisan make:auth
fi

git init
git add .
git commit -m "$MESSAGE"
Expand Down
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ This will `laravel new superApplication`, change into that directory, make an in
lambo superApplication --auth
```

- `-n` or `--node` to run `yarn` if installed, otherwise runs `npm install` after creating the project

```bash
lambo superApplication --node
```

## Requirements

- Mac or Ubuntu.
Expand Down

0 comments on commit e7e84b2

Please sign in to comment.