Skip to content

Instantly share code, notes, and snippets.

@magnusnordlander
Last active August 8, 2019 11:42
Show Gist options
  • Save magnusnordlander/d515505ee832f50210fb5ee36a83bd40 to your computer and use it in GitHub Desktop.
Save magnusnordlander/d515505ee832f50210fb5ee36a83bd40 to your computer and use it in GitHub Desktop.
#!/bin/bash
function dce {
if [[ -f .maincontainer ]]; then
docker-compose exec $(cat .maincontainer) $*
else
echo "Could not find .maincontainer file"
fi
}
function dcr {
if [[ -f .maincontainer ]]; then
docker-compose run $(cat .maincontainer) $*
else
echo "Could not find .maincontainer file"
fi
}
function dcomposer
if [[ -f .maincontainer ]]; then
export COMPOSE_API_VERSION="auto"
export __COMPOSER_AUTH=$(cat ~/.composer/auth.json)
docker-compose exec -e COMPOSER_AUTH="$__COMPOSER_AUTH" -e COMPOSER_MEMORY_LIMIT=4G $(cat .maincontainer) composer $*
else
echo "Could not find .maincontainer file"
fi
fi
function dphpunit {
dce php ./$(composer config bin-dir)/phpunit $*
}
function dsf {
if [[ -f bin/console ]]; then
dce php bin/console $*
elif [[ -f app/console ]]; then
dce php app/console $*
elif [[ -f $(composer config bin-dir)/console ]]; then
dce php ./$(composer config bin-dir)/console $*
else
echo "Could not find Symfony console"
fi
}
# Go to https://github.com/fervo-and-friends/symf-fish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment