Skip to content

Instantly share code, notes, and snippets.

@abhi1010
Created January 26, 2017 08:55
Show Gist options
  • Save abhi1010/2fe3b5dac576fb595d12691262743133 to your computer and use it in GitHub Desktop.
Save abhi1010/2fe3b5dac576fb595d12691262743133 to your computer and use it in GitHub Desktop.
how to write invoke commands that reach other folders
@task
def find():
with cd('../../pylib/gh_hazardous_sol/'):
print('finding tasks')
res = check_output(['/opt/py27env/bin/invoke', '-l'])
print('results = {}'.format(res))
if 'build' in res:
print('we got build command')
# currently all build code is common across all pylibs, through pylib/tasks.py.
# folders like gh_hazardous_sol simply call pylib/tasks.py->build function if it exists
# With this code, it will have to be the other way around.
# if the individual folder has got it's own build function, then pylib/tasks.py->build should call that
run('/opt/py27env/bin/invoke build')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment