Skip to content

Commit

Permalink
Update 'open' to use custom Valet TLD
Browse files Browse the repository at this point in the history
  • Loading branch information
mattstauffer committed Aug 16, 2016
1 parent a5fbbd1 commit e5c8ff3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lambo
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ do
echo "-e, --editor EDITOR specify an editor to run 'EDITOR .' with after"
echo "-m, --message \"message\" customize the initial commit message"
echo "-p, --path PATH customize the path in which the new project will be created"
echo "-d, --develop use Composer to install on the develop branch"
echo "-d, --develop use Composer to install on the develop branch"
quit
;;
-p|--path)
Expand Down Expand Up @@ -109,7 +109,9 @@ sed -i '' "/DB_DATABASE/s/homestead/$PROJECTNAME/" .env
sed -i '' '/DB_USERNAME/s/homestead/root/' .env
sed -i '' '/DB_PASSWORD/s/secret//' .env

open "http://$PROJECTNAME.dev"
# Open the domain using the Valet-specified TLD; avoids requiring sudo
# with `valet open`
php -r "\$tld=json_decode(file_get_contents('$HOME/.valet/config.json'), true)['domain']; echo 'http://$PROJECTNAME.' . \$tld;" | xargs open

This comment has been minimized.

Copy link
@mattstauffer

mattstauffer Aug 16, 2016

Author Member

Scary, I know. Still trying to figure out why valet open requires sudo some times.

This comment has been minimized.

Copy link
@michaeldyrynda

michaeldyrynda Aug 17, 2016

Did you wind up trying to run valet install again?

This comment has been minimized.

Copy link
@mattstauffer

mattstauffer via email Aug 17, 2016

Author Member

This comment has been minimized.

Copy link
@michaeldyrynda

michaeldyrynda Aug 17, 2016

Given the above, I assume you added the sudoers sudoers.d entry manually as well?

This comment has been minimized.

Copy link
@mattstauffer

mattstauffer Aug 17, 2016

Author Member

I checked my sudoers directory and there was a valet record there. Don't know enough about sudoers to validate whether the file is or isn't set up correctly.

This comment has been minimized.

Copy link
@michaeldyrynda

michaeldyrynda Aug 17, 2016

Contents of /etc/sudoers.d/valet are

Cmnd_Alias VALET = /usr/local/bin/valet *
%admin ALL=(root) NOPASSWD: VALET

And permissions:

sudo chown root:wheel /etc/sudoers.d/valet
sudo chmod 644 /etc/sudoers.d/valet

Also, run id from the terminal and make sure that you're in the admin group, as users in that group should have permission to sudo valet without a password.

This comment has been minimized.

Copy link
@mattstauffer

mattstauffer Aug 17, 2016

Author Member

Thanks for looking! Yep, that's my setup.


# @todo: Can we make this work with a ternary style assignment instead?
if [ $PROJECTPATH == "." ]
Expand Down

0 comments on commit e5c8ff3

Please sign in to comment.