Add auto apply scripts
This commit is contained in:
3
shell/aliases.sh
Normal file
3
shell/aliases.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
alias uplog='sudo docker compose up -d && sudo docker compose logs -f'
|
||||
alias downup='sudo docker compose down && sudo docker compose up -d && sudo docker compose logs -f'
|
||||
alias dotenv='set -o allexport && source .env && echo "Applied variables from .env" && grep -v "^\s*#" .env | cut -d "=" -f 1'
|
||||
15
shell/apply.sh
Normal file
15
shell/apply.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
append_to_bashrc() {
|
||||
local bashrc="$HOME/.bashrc"
|
||||
for file in "$@"; do
|
||||
while IFS= read -r line; do
|
||||
[[ -z "$line" ]] && continue
|
||||
if ! grep -Fxq "$line" "$bashrc"; then
|
||||
echo "$line" >> "$bashrc"
|
||||
echo "Add: $line to bashrc"
|
||||
fi
|
||||
done < "$file"
|
||||
done
|
||||
}
|
||||
|
||||
append_to_bashrc aliases.sh bashrc.sh
|
||||
1
shell/bashrc.sh
Normal file
1
shell/bashrc.sh
Normal file
@@ -0,0 +1 @@
|
||||
export GPG_TTY=$(tty)
|
||||
Reference in New Issue
Block a user