Skip to content

Instantly share code, notes, and snippets.

@hiranthi
Created September 30, 2025 09:02
Show Gist options
  • Save hiranthi/2a91027745a3b10b417af512a03b7ebd to your computer and use it in GitHub Desktop.
Save hiranthi/2a91027745a3b10b417af512a03b7ebd to your computer and use it in GitHub Desktop.
# Alias needed in both npm-functions
alias clearCache="php artisan optimize:clear && php artisan cache:clear && php artisan config:clear"
# The path to our project directory
export PROJECT_DIR="$HOME/Development"
# Methods
function npmInstall() {
cd "${PROJECT_DIR}"
npm install && composer install && php artisan migrate && clearCache && echo "[npmInstall] || $(date '+%d-%m-%Y %H:%M:%S')\n\n"
}
function npmClear() {
cd "${PROJECT_DIR}"
clearCache && echo "[npmClear] || $(date '+%d-%m-%Y %H:%M:%S')\n\n"
}
# NPM Aliasses
alias npmclear="npmClear"
alias npm_clear="npmClear"
alias npminstall="npmInstall"
alias npm_install="npmInstall"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment