From 0936f090b3d93366f3223d0dafad673bbb9d5a37 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Thu, 12 May 2016 22:16:21 -0400 Subject: [PATCH] Remove current-domain in favor of domain with no args (#61) --- cli/valet.php | 27 ++++++++++++--------------- valet | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/cli/valet.php b/cli/valet.php index 9d1e85f..240d7e1 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -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. diff --git a/valet b/valet index 03bebce..75d97b0 100755 --- a/valet +++ b/valet @@ -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" ]]