Created
January 26, 2017 08:55
-
-
Save abhi1010/2fe3b5dac576fb595d12691262743133 to your computer and use it in GitHub Desktop.
how to write invoke commands that reach other folders
This file contains hidden or 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
@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