Skip to content

Commit

Permalink
Merge pull request #323 from jolicode/completion
Browse files Browse the repository at this point in the history
Add support for autocomplete (composer & symfony)
  • Loading branch information
pyrech authored Sep 27, 2024
2 parents 25fb047 + 979715c commit b8136b8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Update Composer to version 2.7
* Update NodeJS to version 20.x LTS
* Upgrade base to Debian Bookworm (12.5)
* Add support for autocomplete (composer & symfony)

## 3.11.0 (2023-05-30)

Expand Down
17 changes: 17 additions & 0 deletions infrastructure/docker/services/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apt-get update \

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash-completion \
procps \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
Expand Down Expand Up @@ -118,11 +119,27 @@ COPY --from=composer/composer:2.7.7 /usr/bin/composer /usr/bin/composer
RUN mkdir -p "/home/app/.composer/cache" \
&& chown app: /home/app/.composer -R

ADD https://raw.githubusercontent.com/symfony/symfony/refs/heads/7.2/src/Symfony/Component/Console/Resources/completion.bash /tmp/completion.bash

# Composer symfony/console version is too old, and doest not support "API version feature", so we remove it
# Hey, while we are at it, let's add some more completion
RUN sed /tmp/completion.bash \
-e "s/{{ COMMAND_NAME }}/composer/g" \
-e 's/"-a{{ VERSION }}"//g' \
-e "s/{{ VERSION }}/1/g" \
> /etc/bash_completion.d/composer \
&& sed /tmp/completion.bash \
-e "s/{{ COMMAND_NAME }}/console/g" \
-e "s/{{ VERSION }}/1/g" \
> /etc/bash_completion.d/console

# Third party tools
ENV PATH="$PATH:/var/www/tools/bin"

# Good default customization
RUN cat >> /etc/bash.bashrc <<EOF
. /etc/bash_completion

PS1='\[\e[01;33m\]\u \[\e[00;32m\]\w\[\e[0m\] '
EOF

Expand Down

0 comments on commit b8136b8

Please sign in to comment.