chezmoi init
This commit is contained in:
commit
530d6d7195
1176 changed files with 111325 additions and 0 deletions
66
dot_oh-my-zsh/plugins/drush/README.md
Normal file
66
dot_oh-my-zsh/plugins/drush/README.md
Normal file
|
@ -0,0 +1,66 @@
|
|||
# Drush
|
||||
|
||||
This plugin adds aliases and functions for [Drush](https://www.drush.org), a command-line shell
|
||||
and Unix scripting interface for Drupal. It also adds completion for the `drush` command.
|
||||
|
||||
To enable it, add `drush` to the plugins array in zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... drush)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
| ------- | ----------------------------------------------------------- | -------------------------------------------------------------------- |
|
||||
| `dr` | `drush` | Display drush help |
|
||||
| `drca` | `drush cc all` | _(Deprecated in Drush 8)_ Clear all drupal caches |
|
||||
| `drcb` | `drush cc block` | _(Deprecated in Drush 8)_ Clear block cache |
|
||||
| `drcex` | `drush config:export -y` | Export Drupal configuration to a directory |
|
||||
| `drcg` | `drush cc registry` | _(Deprecated in Drush 8)_ Clear registry cache |
|
||||
| `drcim` | `drush config:import -y` | Import config from a config directory |
|
||||
| `drcj` | `drush cc css-js` | Clear css-js cache |
|
||||
| `drcm` | `drush cc menu` | Clear menu cache |
|
||||
| `drcml` | `drush cc module-list` | Clear module-list cache |
|
||||
| `drcr` | `drush core-cron` | Run all cron hooks in all active modules for specified site |
|
||||
| `drct` | `drush cc theme-registry` | Clear theme-registry cache |
|
||||
| `drcv` | `drush cc views` | Clear views cache _(make sure that the views module is enabled)_ |
|
||||
| `drdmp` | `drush drush sql-dump --ordered-dump --result-file=dumpsql` | Backup database in a new dump.sql file |
|
||||
| `drf` | `drush features` | Display features status |
|
||||
| `drfr` | `drush features-revert -y` | Revert a feature module on your site |
|
||||
| `drfra` | `drush features-revert-all` | Revert all enabled feature module on your site |
|
||||
| `drfu` | `drush features-update -y` | Update a feature module on your site |
|
||||
| `drif` | `drush image-flush --all` | Flush all derived images |
|
||||
| `drpm` | `drush pm-list --type=module` | Show a list of available modules |
|
||||
| `drst` | `drush core-status` | Provides a birds-eye view of the current Drupal installation, if any |
|
||||
| `druli` | `drush user:login` | Display a one time login link for user ID 1, or another user |
|
||||
| `drup` | `drush updatedb` | Apply any database updates required (as with running update.php) |
|
||||
| `drups` | `drush updatedb-status` | List any pending database updates |
|
||||
| `drv` | `drush version` | Show drush version |
|
||||
| `drvd` | `drush variable-del` | Delete a variable |
|
||||
| `drvg` | `drush variable-get` | Get a list of some or all site variables and values |
|
||||
| `drvs` | `drush variable-set` | Set a variable |
|
||||
| `drws` | `drush watchdog:show` | Show watchdog messages |
|
||||
| `drwse` | `drush watchdog:show --extended` | Show watchdog messages with extended information |
|
||||
| `drwst` | `drush watchdog:tail` | Tail watchdog messages |
|
||||
|
||||
## Functions
|
||||
|
||||
- `dren`: download and enable one or more extensions (modules or themes). Must be
|
||||
invoked with one or more parameters, e.g.: `dren devel` or `dren devel module_filter views`.
|
||||
|
||||
- `drf`: edit drushrc, site alias, and Drupal settings.php files.
|
||||
Can be invoked with one or without parameters, e.g.: `drf 1`.
|
||||
|
||||
- `dris`: disable one or more extensions (modules or themes). Must be invoked with
|
||||
one or more parameters, e.g.: `dris devel` or `dris devel module_filter views`.
|
||||
|
||||
- `drpu`: uninstall one or more modules. Must be invoked with one or more
|
||||
parameters, e.g.: `drpu devel` or `drpu devel module_filter views`.
|
||||
|
||||
- `drnew`: creates a brand new drupal website. Note: as soon as the installation
|
||||
is complete, `drush` will print a username and a random password into the terminal:
|
||||
|
||||
```text
|
||||
Installation complete. User name: admin User password: cf7t8yqNEm
|
||||
```
|
50
dot_oh-my-zsh/plugins/drush/drush.complete.sh
Normal file
50
dot_oh-my-zsh/plugins/drush/drush.complete.sh
Normal file
|
@ -0,0 +1,50 @@
|
|||
# BASH completion script for Drush.
|
||||
#
|
||||
# Place this in your /etc/bash_completion.d/ directory or source it from your
|
||||
# ~/.bash_completion or ~/.bash_profile files. Alternatively, source
|
||||
# examples/example.bashrc instead, as it will automatically find and source
|
||||
# this file.
|
||||
#
|
||||
# If you're using ZSH instead of BASH, add the following to your ~/.zshrc file
|
||||
# and source it.
|
||||
#
|
||||
# autoload bashcompinit
|
||||
# bashcompinit
|
||||
# source /path/to/your/drush.complete.sh
|
||||
|
||||
# Ensure drush is available.
|
||||
which drush > /dev/null || alias drush &> /dev/null || return
|
||||
|
||||
__drush_ps1() {
|
||||
f="${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$"
|
||||
if [ -f $f ]
|
||||
then
|
||||
__DRUPAL_SITE=$(cat "$f")
|
||||
else
|
||||
__DRUPAL_SITE="$DRUPAL_SITE"
|
||||
fi
|
||||
|
||||
# Set DRUSH_PS1_SHOWCOLORHINTS to a non-empty value and define a
|
||||
# __drush_ps1_colorize_alias() function for color hints in your Drush PS1
|
||||
# prompt. See example.prompt.sh for an example implementation.
|
||||
if [ -n "${__DRUPAL_SITE-}" ] && [ -n "${DRUSH_PS1_SHOWCOLORHINTS-}" ]; then
|
||||
__drush_ps1_colorize_alias
|
||||
fi
|
||||
|
||||
[[ -n "$__DRUPAL_SITE" ]] && printf "${1:- (%s)}" "$__DRUPAL_SITE"
|
||||
}
|
||||
|
||||
# Completion function, uses the "drush complete" command to retrieve
|
||||
# completions for a specific command line COMP_WORDS.
|
||||
_drush_completion() {
|
||||
# Set IFS to newline (locally), since we only use newline separators, and
|
||||
# need to retain spaces (or not) after completions.
|
||||
local IFS=$'\n'
|
||||
# The '< /dev/null' is a work around for a bug in php libedit stdin handling.
|
||||
# Note that libedit in place of libreadline in some distributions. See:
|
||||
# https://bugs.launchpad.net/ubuntu/+source/php5/+bug/322214
|
||||
COMPREPLY=( $(drush --early=includes/complete.inc "${COMP_WORDS[@]}" < /dev/null 2> /dev/null) )
|
||||
}
|
||||
|
||||
# Register our completion function. We include common short aliases for Drush.
|
||||
complete -o bashdefault -o default -o nospace -F _drush_completion d dr drush drush5 drush6 drush7 drush8 drush.php
|
107
dot_oh-my-zsh/plugins/drush/drush.plugin.zsh
Normal file
107
dot_oh-my-zsh/plugins/drush/drush.plugin.zsh
Normal file
|
@ -0,0 +1,107 @@
|
|||
# Functions
|
||||
function dren() {
|
||||
drush en "$@" -y
|
||||
}
|
||||
|
||||
function dris() {
|
||||
drush pm-disable "$@" -y
|
||||
}
|
||||
|
||||
function drpu() {
|
||||
drush pm-uninstall "$@" -y
|
||||
}
|
||||
|
||||
function drf() {
|
||||
if [[ -z "$1" ]] then
|
||||
drush core-config
|
||||
else
|
||||
drush core-config --choice=$1
|
||||
fi
|
||||
}
|
||||
|
||||
function drfi() {
|
||||
case "$1" in
|
||||
fields) drush field-info fields ;;
|
||||
types) drush field-info types ;;
|
||||
*) drush field-info ;;
|
||||
esac
|
||||
}
|
||||
|
||||
function drnew() {
|
||||
(
|
||||
cd
|
||||
echo "Website's name: "
|
||||
read WEBSITE_NAME
|
||||
|
||||
HOST=http://$(hostname -i)/
|
||||
|
||||
if [[ $WEBSITE_NAME == "" ]] then
|
||||
MINUTES=$(date +%M:%S)
|
||||
WEBSITE_NAME="Drupal-$MINUTES"
|
||||
echo "Your website will be named: $WEBSITE_NAME"
|
||||
fi
|
||||
|
||||
drush dl drupal --drupal-project-rename=$WEBSITE_NAME
|
||||
|
||||
echo "Type your localhost directory: (Leave empty for /var/www/html/)"
|
||||
read DIRECTORY
|
||||
|
||||
if [[ $DIRECTORY == "" ]] then
|
||||
DIRECTORY="/var/www/html/"
|
||||
fi
|
||||
|
||||
echo "Moving to $DIRECTORY$WEBSITE_NAME"
|
||||
sudo mv $WEBSITE_NAME $DIRECTORY
|
||||
cd $DIRECTORY$WEBSITE_NAME
|
||||
|
||||
echo "Database's user: "
|
||||
read DATABASE_USR
|
||||
echo "Database's password: "
|
||||
read -s DATABASE_PWD
|
||||
echo "Database's name for your project: "
|
||||
read DATABASE
|
||||
|
||||
DB_URL="mysql://$DATABASE_USR:$DATABASE_PWD@localhost/$DATABASE"
|
||||
drush site-install standard --db-url=$DB_URL --site-name=$WEBSITE_NAME
|
||||
|
||||
open_command $HOST$WEBSITE_NAME
|
||||
echo "Done"
|
||||
)
|
||||
}
|
||||
|
||||
# Aliases
|
||||
alias dr="drush"
|
||||
alias drca="drush cc all" # Deprecated for Drush 8
|
||||
alias drcb="drush cc block" # Deprecated for Drush 8
|
||||
alias drcex="drush config:export -y"
|
||||
alias drcg="drush cc registry" # Deprecated for Drush 8
|
||||
alias drcim="drush config:import -y"
|
||||
alias drcj="drush cc css-js"
|
||||
alias drcm="drush cc menu"
|
||||
alias drcml="drush cc module-list"
|
||||
alias drcr="drush core-cron"
|
||||
alias drct="drush cc theme-registry"
|
||||
alias drcv="drush cc views"
|
||||
alias drdmp="drush sql-dump --ordered-dump --result-file=dump.sql"
|
||||
alias drf="drush features"
|
||||
alias drfr="drush features-revert -y"
|
||||
alias drfra="drush features-revert-all"
|
||||
alias drfu="drush features-update -y"
|
||||
alias drif="drush image-flush --all"
|
||||
alias drpm="drush pm-list --type=module"
|
||||
alias drst="drush core-status"
|
||||
alias druli="drush user:login"
|
||||
alias drup="drush updatedb"
|
||||
alias drups="drush updatedb-status"
|
||||
alias drv="drush version"
|
||||
alias drvd="drush variable-del"
|
||||
alias drvg="drush variable-get"
|
||||
alias drvs="drush variable-set"
|
||||
alias drws="drush watchdog:show"
|
||||
alias drwse="drush watchdog:show --extended"
|
||||
alias drwst="drush watchdog:tail"
|
||||
|
||||
# Enable drush autocomplete support
|
||||
autoload bashcompinit
|
||||
bashcompinit
|
||||
source $(dirname $0)/drush.complete.sh
|
Loading…
Add table
Add a link
Reference in a new issue