Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy for Drush commands #635

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cli/valet.php
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,10 @@
$app->command('configure', function () {
DriverConfigurator::configure();
})->descriptions('Configure application with know framework settings');

$app->command('which-uri', function () {
return output( Site::domain(null));
})->descriptions('Displays the URL of the current site');
}

/**
Expand Down
14 changes: 14 additions & 0 deletions valet-plus
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,20 @@ then

exit

# Proxy Drush commands with the "php" executable on the isolated site
elif [[ "$1" = "drush" ]]
then
if [[ $2 == *"--site="* ]]; then
SITE=${2#*=}
$(php "$DIR/cli/valet.php" which-php $SITE) $(which drush) "${@:3}"
elif [[ $2 == "uli" ]]; then
$(php "$DIR/cli/valet.php" which-php) $(which drush) uli --uri=$(php "$DIR/cli/valet.php" which-uri) "${@:3}"
else
$(php "$DIR/cli/valet.php" which-php) $(which drush) "${@:2}"
fi

exit

# Finally, for every other command we will just proxy into the PHP tool
# and let it handle the request. These are commands which can be run
# without sudo and don't require taking over terminals like Ngrok.
Expand Down
Loading