You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
582 B

  1. #!/bin/bash
  2. SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
  3. . $SCRIPT_DIR/_docker-cmd.sh || {
  4. echo "no docker cmd is presented" && exit 1
  5. }
  6. PHP_VERSION=$1 # Without dot
  7. COMPOSER_VERSION=$2
  8. if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=74; fi
  9. CONTAINER=$(docker ps | grep workspace${PHP_VERSION} | awk '{print $1}')
  10. if [[ -z "${CONTAINER}" ]]; then
  11. echo "Unable to find container: workspace${PHP_VERSION}"
  12. exit 1
  13. fi
  14. if [[ -z "${COMPOSER_VERSION}" ]]; then
  15. COMPOSER_VERSION=1
  16. fi
  17. $DOCKER_CMD exec -ti "${CONTAINER}" composer self-update --${COMPOSER_VERSION}