From f83ed54b4804b5fb65289df682a03e199022c3c2 Mon Sep 17 00:00:00 2001 From: pika Date: Fri, 16 Aug 2024 15:12:05 +0200 Subject: [PATCH] addet support for coding (php and npm) --- .bashrc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 0129df1..cf4fc9f 100644 --- a/.bashrc +++ b/.bashrc @@ -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"