mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
Magento 2 plugin INIT
This commit is contained in:
parent
62b0abdb6e
commit
5be12e37ee
2 changed files with 50 additions and 0 deletions
31
plugins/magento2/magento2.plugin.zsh
Normal file
31
plugins/magento2/magento2.plugin.zsh
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#
|
||||
# Magento2 oh-my-zsh plugin
|
||||
#
|
||||
# Copyright (c) 2016 Denis Ristic <me@denisristic.com>
|
||||
# Depend of Oh My Zsh (https://github.com/robbyrussell/oh-my-zsh)
|
||||
#
|
||||
# Distributed under the GNU GPL v2. For full terms see the file LICENSE.
|
||||
#
|
||||
|
||||
|
||||
_magento2_console () {
|
||||
echo "php $(find . -maxdepth 2 -mindepth 1 -name 'magento' -type f | head -n 1)"
|
||||
}
|
||||
|
||||
_magento2_get_command_list () {
|
||||
`_magento2_console` --no-ansi | awk '/ ([a-z\:])* .*/ { print $1 }'
|
||||
}
|
||||
|
||||
_magento2 () {
|
||||
compadd `_magento2_get_command_list`
|
||||
}
|
||||
|
||||
compdef _magento2 '`_magento2_console`'
|
||||
|
||||
#aliases
|
||||
alias m2='`_magento2_console`'
|
||||
alias m2clean='`_magento2_console` cache:clean'
|
||||
alias m2reindex='`_magento2_console` indexer:reindex'
|
||||
alias m2compile='`_magento2_console` setup:di:compile'
|
||||
alias m2upgrade='`_magento2_console` setup:upgrade'
|
||||
alias m2deploy='`_magento2_console` setup:static-content:deploy'
|
||||
Loading…
Add table
Add a link
Reference in a new issue