addet support for coding (php and npm)

This commit is contained in:
pika 2024-08-16 15:12:05 +02:00
parent 5a11540bf8
commit f83ed54b48

15
.bashrc
View file

@ -357,6 +357,20 @@ _coding_() {
fi
fi
fi
# Function to get the IP address
get_ip() {
ip a | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d/ -f1 | head -n 1
}
# Check if php is available, then create the alias
if command -v php >/dev/null 2>&1; then
alias phprun="php artisan serve --host=$(get_ip) --port=8000"
fi
# Check if npm is available, then create the alias
if command -v npm >/dev/null 2>&1; then
alias npmrun="npm run dev -- --host=$(get_ip) --port=8001"
fi
}
get_packager() {
@ -429,7 +443,6 @@ get_packager() {
update="apk update"
upgrade="apk upgrade"
remove="apk del"
alias install="$_sudo $install"
alias update="$_sudo $update && $_sudo $upgrade"
alias remove="$_sudo $remove"