🚀 Welcome to drush-launcher, a heartfelt tribute and robust successor to the original drush-launcher.
The only intention for this project was to preserve a future for system-level drush command that is able to bootstrap the the proper drush executable in a project.
There's a space for this. Some of us need a binary in our $PATH to call from any directory, not necessarily a bash function. Some host on systems with several Drupal installations. Finally, some of us aren't running containers that are specific to our application. Finally, it allows you to run drush from anywhere in your project and it knows what executable you meant to run.
- 💡 Drush 12 Compatibility: Unlike its predecessor,
drush-launcherembraces Drush 12, ensuring your projects stay up-to-date and efficient. - 🌍 System-wide Installation: Seamlessly integrates into your $PATH, providing universal access to the
drushexecutable. - 🌟 Community-Driven: Born from community needs and nurtured by proactive problem-solving.
Simple, system-wide setup ensures drush is always at your fingertips. Just a few commands, and you're all set!
Installation is as simple as running the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/dasginganinja/drush-launcher/main/download_and_build.sh)"
This will download a prebuilt file for your system based on the detected OS and Architecture and will be available at drush-launcher_* in the same directory.
Run go build in the project directory.
This will create an executable called drush-launcher.
For more details or different OS/platform targets, refer to the Go build documentation. These can be controlled via the
$GOARCHand$GOOSenvironment variables when running the build.
It is recommended to install this binary to /usr/local/bin/drush so this is the preferred fallback drush executable in the $PATH.
As an example, one could run this to copy the file.
sudo cp -n drush-launcher /usr/local/bin/drush
If drush launcher already exists at the location it will not be overwritten with the above command because
-nmeans to not overwrite the file if it exists.
For standard usage, just run this as you normally would drush.
This executable supports one flag for setting the Drupal root via -r or --root, in case it wasn't detected automatically in the current or parent directories.
All other flags and arguments are passed on, including the aforementioned root options.
Execute go test to run tests.
Your feedback and merge requests are highly valued! If you have ideas or improvements that align with the project's purpose, please feel welcome to contribute. Together, we can enhance drush-launcher for everyone!
Discover more and contribute on our GitHub repository.