1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00

Remove current-domain in favor of domain with no args (#61)

This commit is contained in:
Adam Wathan
2016-05-12 22:16:21 -04:00
committed by Taylor Otwell
parent fbd3c604ef
commit 0936f090b3
2 changed files with 13 additions and 16 deletions

View File

@@ -50,24 +50,21 @@
})->descriptions('Install the Valet services');
/**
* Change the domain currently being used by Valet.
* Get or set the domain currently being used by Valet.
*/
$app->command('domain domain', function ($domain) {
DnsMasq::updateDomain(
Configuration::read()['domain'], $domain = trim($domain, '.')
);
$app->command('domain [domain]', function ($domain = null) {
if ($domain === null) {
info(Configuration::read()['domain']);
} else {
DnsMasq::updateDomain(
Configuration::read()['domain'], $domain = trim($domain, '.')
);
Configuration::updateKey('domain', $domain);
Configuration::updateKey('domain', $domain);
info('Your Valet domain has been updated to ['.$domain.'].');
})->descriptions('Set the domain used for Valet sites');
/**
* Get the domain currently being used by Valet.
*/
$app->command('current-domain', function () {
info(Configuration::read()['domain']);
})->descriptions('Get the current Valet domain');
info('Your Valet domain has been updated to ['.$domain.'].');
}
})->descriptions('Get or set the domain used for Valet sites');
/**
* Add the current working directory to the paths configuration.

2
valet
View File

@@ -43,7 +43,7 @@ then
elif [[ "$1" = "share" ]]
then
HOST="${PWD##*/}"
DOMAIN=$(php "$DIR/cli/valet.php" current-domain)
DOMAIN=$(php "$DIR/cli/valet.php" domain)
for linkname in ~/.valet/Sites/*; do
if [[ "$(readlink $linkname)" = "$PWD" ]]