Last active
September 14, 2018 03:42
-
-
Save shadow-light/84f1e0ee45d699e1ba066a85ac31d52a to your computer and use it in GitHub Desktop.
How to create a script, using invoke, that you can execute directly
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
#!/usr/bin/env python | |
import sys | |
from invoke import task, Collection, Program | |
@task | |
def say_hi(ctx): | |
print('hi!') | |
if __name__ == '__main__': | |
Program(namespace=Collection.from_module(sys.modules[__name__])).run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment