Generic Fabric executation example.
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
| """Common functions and data structures exposed to other modules in package.""" | |
| from fabric.api import * | |
| def run_or_local(*args, **kwargs): | |
| """Execute a command locally if env.host=='localhost'.""" | |
| if env.host_string=='localhost': | |
| return local(capture=True, *args, **kwargs) | |
| else: | |
| return run(*args, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment