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.

18 lines
435 B

  1. #!/bin/bash
  2. PHP_VERSION=$1 # Without dot
  3. COMPOSER_VERSION=$2
  4. if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=74; fi
  5. CONTAINER=$(docker ps | grep workspace${PHP_VERSION} | awk '{print $1}')
  6. if [[ -z "${CONTAINER}" ]]; then
  7. echo "Unable to find container: workspace${PHP_VERSION}"
  8. exit 1
  9. fi
  10. if [[ -z "${COMPOSER_VERSION}" ]]; then
  11. COMPOSER_VERSION=1
  12. fi
  13. docker exec -ti "${CONTAINER}" composer self-update --${COMPOSER_VERSION}