mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-12 01:52:31 +01:00
feat: adds the Laravel Sail plugin
This commit is contained in:
parent
bbda81fe4b
commit
65419fa13c
3 changed files with 92 additions and 0 deletions
30
plugins/sail/sail.plugin.zsh
Normal file
30
plugins/sail/sail.plugin.zsh
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Laravel Sail ZSH plugin
|
||||
#
|
||||
# Setting
|
||||
: ${SAIL_ZSH_BIN_PATH:="./vendor/bin/sail"}
|
||||
|
||||
# Enable multiple commands with sail
|
||||
function artisan \
|
||||
composer \
|
||||
node \
|
||||
npm \
|
||||
npx \
|
||||
php \
|
||||
yarn {
|
||||
if checkForSail; then
|
||||
$SAIL_ZSH_BIN_PATH "$0" "$@"
|
||||
else
|
||||
command "$0" "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
# Check for the file in the current and parent directories.
|
||||
checkForSail() {
|
||||
# Check if ./vendor directory exists and if ./vendor/bin/sail file exists.
|
||||
if [ -f $SAIL_ZSH_BIN_PATH ]; then
|
||||
return 0
|
||||
else
|
||||
# Could not find $SAIL_ZSH_BIN_PATH in the current directory
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue