Skip to content

auto-compat with OpenTofu, co-pilot suggestions and other last-minute ideas #2306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions aliases/available/general.aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ alias ipy='ipython'

alias piano='pianobar'

alias ..='cd ..' # Go up one directory
alias cd..='cd ..' # Common misspelling for going up one directory
alias ...='cd ../..' # Go up two directories
alias ....='cd ../../..' # Go up three directories
alias -- -='cd -' # Go back
alias dow='cd /home/$USER/Downloads' # Go to the Downloads directory
alias ..='cd ..' # Go up one directory
alias cd..='cd ..' # Common misspelling for going up one directory
alias ...='cd ../..' # Go up two directories
alias ....='cd ../../..' # Go up three directories
alias -- -='cd -' # Go back
alias dow='cd $HOME/Downloads' # Go to the Downloads directory

# Shell History
alias h='history'
Expand Down
3 changes: 2 additions & 1 deletion aliases/available/git.aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi

alias g='git'
alias get='git'
alias got='git '
alias got='git'

# add
alias ga='git add'
Expand Down Expand Up @@ -111,6 +111,7 @@ alias gm='git merge'
alias gma='git merge --abort'
alias gmc='git merge --continue'
alias gms='git merge --squash'
alias gmt='git mergetool'

# mv
alias gmv='git mv'
Expand Down
9 changes: 8 additions & 1 deletion aliases/available/laravel.aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ about-alias 'laravel artisan abbreviations'

# A list of useful laravel aliases

alias laravel='${HOME?}/.composer/vendor/bin/laravel'
if [[ -x "${HOME?}/.config/composer/vendor/bin/laravel" ]]; then
alias laravel='${HOME?}/.config/composer/vendor/bin/laravel'
elif [[ -x "${HOME?}/.composer/vendor/bin/laravel" ]]; then
alias laravel='${HOME?}/.composer/vendor/bin/laravel'
else
return
fi

# asset
alias a:apub='php artisan asset:publish'

Expand Down
28 changes: 20 additions & 8 deletions aliases/available/terraform.aliases.bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
# shellcheck shell=bash
about-alias 'Aliases for Terraform and Terragrunt'
about-alias 'Aliases for Terraform/OpenTofu and Terragrunt'

alias tf='terraform'
alias tfi='tf init'
alias tfv='terraform validate'
alias tfp='terraform plan'
alias tfa='terraform apply'
alias tfd='terraform destroy'
alias tfw='terraform workspace'
if _command_exists terraform; then
alias tf='terraform'
elif _command_exists tofu; then
alias tf='tofu'
fi

if _command_exists tf; then
alias tfa='tf apply'
alias tfp='tf plan'
alias tfd='tf destroy'
alias tfv='tf validate'
alias tfi='tf init'
alias tfo='tf output'
alias tfr='tf refresh'
alias tfw='tf workspace'
alias tfae='tf apply -auto-approve'
alias tfpa='tf plan -out=tfplan && tf apply tfplan'
alias tfpaf='tf plan -out=tfplan && tf apply -auto-approve tfplan'
fi
21 changes: 15 additions & 6 deletions completion/available/terraform.completion.bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# shellcheck shell=bash

# Make sure terraform is installed
_command_exists terraform || return
if _command_exists terraform; then

# Don't handle completion if it's already managed
complete -p terraform &> /dev/null && return
# Don't handle completion if it's already managed
complete -p terraform &> /dev/null && return

# Terraform completes itself
complete -C terraform terraform
# Terraform completes itself
complete -C terraform terraform

elif _command_exists tofu; then

# Don't handle completion if it's already managed
complete -p tofu &> /dev/null && return

# OpenTofu completes itself
complete -C tofu tofu

fi
Loading