-
-
Save Nemo64/4dd20d5a92f95388f0be to your computer and use it in GitHub Desktop.
Symfony app/console or bin/console shortcut to the simple letter "c". It also allows for autocompletion.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CONSOLE_BIN=`symfony_console_binary` | |
if [ $CONSOLE_BIN ] | |
then | |
$CONSOLE_BIN $* | |
else | |
echo "no console binary found" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# autocompletion | |
# reference this file in your .bashrc | |
# source c.bash | |
_c() | |
{ | |
local CACHE_FILE=".symfony-autocomplete" | |
local CONSOLE_BINARY=`symfony_console_binary` | |
if [ $CONSOLE_BINARY ] | |
then | |
local cur | |
_get_comp_words_by_ref -n : cur | |
local words | |
if [ -f $CACHE_FILE ] | |
then words=`cat $CACHE_FILE` | |
else words=`$CONSOLE_BINARY | grep -o -P "^ [\\w:]+" | tee $CACHE_FILE` | |
fi | |
COMPREPLY=( $(compgen -W "$words" -- $cur) ) | |
__ltrim_colon_completions "$cur" | |
fi | |
} | |
complete -F _c c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -f app/console ] | |
then | |
echo app/console | |
else if [ -f bin/console ] | |
then | |
echo bin/console | |
else | |
exit 1 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment