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"