Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
a8dee63f
Unverified
Commit
a8dee63f
authored
Oct 19, 2023
by
Ryan Tvenge
Committed by
Marc Cornellà
Oct 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(lando): bypass `lando` if command is not available in container (#11993)
Closes #11993
parent
104041a0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
lando.plugin.zsh
plugins/lando/lando.plugin.zsh
+11
-3
No files found.
plugins/lando/lando.plugin.zsh
View file @
a8dee63f
...
...
@@ -11,15 +11,23 @@ function artisan \
php
\
wp
\
yarn
{
if
checkForLandoFile
;
then
lando
"
$0
"
"
$@
"
# If the lando task is available in `lando --help`, then it means:
#
# 1. `lando` is in a project with a `.lando.yml` file.
# 2. The lando task is available for lando, based on the .lando.yml config file.
#
# This has a penalty of about 250ms, so we still want to check if the lando file
# exists before, which is the fast path. If it exists, checking help output is
# still faster than running the command and failing.
if
_lando_file_exists
&&
lando
--help
2>&1 |
command grep
-Eq
"^ +lando
$0
"
;
then
command
lando
"
$0
"
"
$@
"
else
command
"
$0
"
"
$@
"
fi
}
# Check for the file in the current and parent directories.
checkForLandoFile
()
{
_lando_file_exists
()
{
# Only bother checking for lando within the Sites directory.
if
[[
"
$PWD
/"
!=
"
$LANDO_ZSH_SITES_DIRECTORY
"
/
*
]]
;
then
# Not within $LANDO_ZSH_SITES_DIRECTORY
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment