addet support for coding (php and npm)
This commit is contained in:
parent
5a11540bf8
commit
f83ed54b48
1 changed files with 14 additions and 1 deletions
15
.bashrc
15
.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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue