Skip to content

Commit

Permalink
bash as default command
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Olszewski committed Feb 9, 2017
1 parent 8207c31 commit bdc1de5
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions mage2docker.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ _mage2docker_report() {
compadd `docker exec -u www-data $1 ls -tr var/report`
}

_mage2docker_log(){
compadd `docker exec -u www-data $1 ls -tr var/log`
}

_mage2docker() {

local curcontext="$curcontext" state line
Expand All @@ -33,7 +37,7 @@ _mage2docker() {
compadd $(_docker_get_container_name)
;;
command)
compadd "$@" bash-www bash logs magento mage mage-cache mage-di mage-upgrade mage-report grunt rename rm restart stop inspect top
compadd "$@" bash-www bash logs magento mage mage-cache mage-di mage-upgrade mage-report mage-log grunt rename rm restart stop inspect top
;;
options)
case $words[3] in
Expand All @@ -42,6 +46,9 @@ _mage2docker() {
;;
mage-report)
_mage2docker_report $words[2]
;;
mage-log)
_mage2docker_log $words[2]
;;
esac
esac
Expand All @@ -58,7 +65,7 @@ mage2docker () {
docker logs -f $1
;;
bash)
docker exec -it $1 bash
docker exec -it -u root $1 bash
;;
bash-www)
docker exec -it -u www-data $1 bash
Expand Down Expand Up @@ -87,8 +94,15 @@ mage2docker () {
mage-report)
docker exec -it -u www-data $1 cat var/report/$3
;;
mage-log)
docker exec -it -u www-data $1 tail -f var/log/$3
;;
*)
docker ps
if [ ! "$1" ]; then
docker ps
else
docker exec -it -u www-data $1 bash
fi
;;
esac

Expand Down

0 comments on commit bdc1de5

Please sign in to comment.