adds bashcompletion
ci/woodpecker/push/test Pipeline failed Details
ci/woodpecker/push/next unknown status Details
ci/woodpecker/push/master unknown status Details

This commit is contained in:
OCram85 2022-11-08 08:40:20 +01:00
parent 1d79a803f7
commit 95353d8fe0
3 changed files with 21 additions and 1 deletions

View File

@ -15,6 +15,15 @@ RUN \
echo 'source /usr/share/bash-completion/completions/git' >> /etc/bash.bashrc
ADD install-devruntime /usr/bin/
ADD install-devruntime-completion /etc/bash_completion.d/
RUN \
chmod +x /usr/bin/install-devruntime && \
echo "echo \"Use 'install-devruntime' to install missing runtimes like dotnet or NodeJs.\"" >> /etc/bash.bashrc
chmod +x /etc/bash_completion.d/install-devruntime-completion && \
echo 'source /etc/bash_completion.d/install-devruntime-completion' >> /etc/bash.bashrc && \
cat <<EOF >> /etc/bash.bashrc && \
if [[ -e "$HOME/enable_motd"]]; then
"echo -e "Use \e[32m'install-devruntime'\e[0m to install missing runtimes like dotnet or NodeJs."
fi
EOF
touch "$HOME/enable_motd"
#echo "echo -e \"Use \\e[32m'install-devruntime'\\e[0m to install missing runtimes like dotnet or NodeJs.\"" >> /etc/bash.bashrc

View File

@ -14,11 +14,19 @@ function showHelp() {
nodejs Installs latest NodeJs LTS version.
powershell Installs latest PowerShell LTS version.
-h Prints this help messagee.
disableMotd Disables hint in new bash terminal
Example 1: install-devruntime dotnet
Example 2: install devruntime golang nodejs
HELP
}
function disableMotd() {
if [[ -e "$HOME/enable_motd"]]; then
say "Disabling 'install-devruntime' motd..." "disableMotd"
rm -f "$HOME/enable_motd"
fi
}
function say() {
if [[ -n "$2" ]]; then
echo -e "\e[32mInstall-DevRuntime\e[0m \e[34m[$2]\e[0m: $1"

View File

@ -0,0 +1,3 @@
#!/bin/bash
complete -W "dotnet golang nodejs powershell -h" install-devruntime