forked from deployphp/deployer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[issue-2170] Modified runLocally function to accept closure
As noted in the issue deployphp#2170, the logic in the recipe/check_remote.php would try to get the binary path of local and remote git executable. However, due to specific implementation, the get('bin/git') would have been called twice in the context of remote host, instead of invoking it once on remote and once on local machine. The runLocally function has thus been reworked, to accept Closure, which will be invoked in the context of the localhost machine. Once a Closure has been passed, the function will push the Localhost to the Context, invoke the closure, store the stdout (if available), pop the Localhost from the Context and finally return the stdout. For compatibility reasons, the function also accepts the string argument, however it is wrapped in a closure and once again passed to the runLocally function. The recipe/check_remote.php file has been reworked, to utilize the Closure, to make sure that the get('bin/git') is being called in the Localhost context.
- Loading branch information
1 parent
44f5f84
commit aa8640a
Showing
3 changed files
with
37 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters