You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running some tasks in a monorepo where all the relevant code for the job is in the ui subdirectory. Is there a more elegant / more DRY way to change the working directory to a subdirectory of the repo than this?
The example above will override the working directory in change_dir_script and every following instruction will respect it.
This behaviour was not intended when we added CIRRUS_ENV but it works. I've added an integration test to make sure the behaviour from the example above won't break.
cool thanks - that seems to work!
I wrote a small starlark utility function to make this less verbose if anyone comes by this:
defchange_working_dir(path):
returnscript("change working directory to {}".format(path), 'echo "CIRRUS_WORKING_DIR=$CIRRUS_WORKING_DIR/{}" >> $CIRRUS_ENV'.format(path))
can be used like this:
task(
instructions= [
change_working_dir("my-sub-dir"),
script("run stuff in sub dir", "echo stuff"),
]
)
Description
I'm running some tasks in a monorepo where all the relevant code for the job is in the
ui
subdirectory. Is there a more elegant / more DRY way to change the working directory to a subdirectory of the repo than this?The text was updated successfully, but these errors were encountered: