install
- su - drupal
- cd /var/www/DRUPALPROJECT
- composer require drush/drush:^12 -w
- ./vendor/bin/drush --version
vim ~/.zshrc
# Add ./vendor/bin to PATH only if it exists
function update_vendor_bin_path() {
if [ -d "$PWD/vendor/bin" ]; then
export PATH="$PWD/vendor/bin:$PATH"
else
# Remove ./vendor/bin from PATH if no longer exists
PATH=$(echo "$PATH" | awk -v RS=: -v ORS=: '/vendor\/bin/ {next} {print}' | sed 's/:$//')
fi
}
# Hook to dynamically update PATH when changing directories
autoload -U add-zsh-hook
add-zsh-hook chpwd update_vendor_bin_path
update_vendor_bin_path # Ensure it's applied to the current directory
start
SITEDOMAIN=DOM.TLD
Theme
- drush -l $SITEDOMAIN pm-list --type=theme
- drush -l $SITEDOMAIN cget system.theme admin
- drush -l $SITEDOMAIN cset system.theme admin adminimal_theme
core.extension
- drush -l $SITEDOMAIN cdel core.extension module.MODULENAME
- https://www.drupal.org/node/3137656
debug
- dr -l $SITEDOMAIN ws
- drush st