Files
env-files/setup-bashrc.sh
Pin Straw da2cd09c65 updates
2026-03-24 00:28:33 -04:00

29 lines
922 B
Bash

#!/bin/bash
mkdir -p ~/.bashrc.d
cat <<'EOF'>~/.bashrc.d/functions
# sample functions
## simple alias
alias k=kubectl
function check-commit {
echo "Running markdownlint"
docker run -u "$(id -u)" --rm -it -v "$(pwd):/data:Z" docker.io/markdownlint/markdownlint:latest .
echo "Running cspell"
cspell
# docker run --rm -it -v "$(pwd):/workdir" --entrypoint="" quay.io/terraform-docs/terraform-docs:0.17.0 sh
# terraform-docs markdown --anchor=false --html=false table --sort-by required
}
alias cspell="docker run --rm -it -v \"\$(pwd):/workdir:Z\" ghcr.io/streetsidesoftware/cspell:latest \"**\""
alias cspell-ignore="cspell | grep -o \"Unknown word (.*)\" | sed -E 's|.*\((.*)\).*|\1|' | sort | uniq | sed -r 's/\\x1B\\[(;?[0-9]{1,3})+[mGK]//g'"
EOF
cat <<'EOF'>~/.bashrc.d/kubectl_config
if [[ -d "$HOME/.kube/config.d" ]]; then
export KUBECONFIG=$(find ~/.kube/config.d/ -type f | tr '\n' ':')
fi
EOF