https://prefect.io logo
Title
l

Lana Dann

05/20/2022, 9:27 PM
is there a way to skip a directory when registering flows with the prefect cli?
k

Kevin Kho

05/20/2022, 9:28 PM
Not specifically…but can’t you point it to the subdirectories instead if that is the case?
l

Lana Dann

05/20/2022, 9:31 PM
i have a flows directory that gets registered and there’s one subdirectory in there that i’d like to not be registered in a specific environment. by default we register all flows in staging and then in production but this subset of flows should only exist in prod 😕
so the alternative would be specifying the rest of the subdirectories which is a hassle… maybe i’m better off just moving that special set of a flows to a different directory
k

Kevin Kho

05/20/2022, 9:34 PM
I think it takes a glob so maybe if you just prefixed it differently and then you can use a wildcard
prefect register --project my-project --path "others-*"
l

Lana Dann

05/20/2022, 9:45 PM
i played around a little and you can exclude patterns like this with glob:
prefect register --project my-project --path "lib/flows/[!pattern]*/*.py"
^ this will register all python files in
lib/flows
subdirectories except for
pattern
thanks!
k

Kevin Kho

05/20/2022, 9:45 PM
Ah nice!