Skip to content

Commit 9c8576e

Browse files
committed
Update docs for new behavior
1 parent f0bf49a commit 9c8576e

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

docs/advanced_config/glob_config_files.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ For example, to run the `plan` command on all the files stored in subdirectoris
1212
dbt-jobs-as-code plan "jobs/**/*.yml" # (1)!
1313
```
1414

15-
1. Depending on your shell you might have to quote the pattern or not. For example, for `zsh` quoting is required as otherwise the shell will try to expand the pattern before passing it to the command.
15+
1. Depending on your shell you might have to quote the pattern or not. For example, for `zsh` quoting is required as otherwise the shell will try to expand the pattern before passing it to the command.
16+
17+
If the provided config is a directory, we automatically search for all the `*.yml` files in this directory. This is particularly relevant for users with a shell not supporting the `*` character.

src/dbt_jobs_as_code/cloud_yaml_mapping/change_set.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,11 @@ def build_change_set(
187187
188188
CONFIG is the path to your jobs.yml config file.
189189
"""
190-
# Get list of files matching the glob pattern
190+
191+
# If the config is a directory, we automatically search for all the `*.yml` files in this directory
191192
if os.path.isdir(config):
192193
config = os.path.join(config, "*.yml")
194+
# Get list of files matching the glob pattern
193195
config_files = glob.glob(config)
194196
if not config_files:
195197
logger.error(f"No files found matching pattern: {config}")

src/dbt_jobs_as_code/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def sync(
9797
"""Synchronize a dbt Cloud job config file against dbt Cloud.
9898
This command will update dbt Cloud with the changes in the local YML file. It is recommended to run a `plan` first to see what will be changed.
9999
100-
CONFIG is the path to your jobs.yml config file or a glob pattern for those files.
100+
CONFIG is the path to your YML jobs config file (also supports glob patterns for those files or a directory).
101101
"""
102102
cloud_project_ids = []
103103
cloud_environment_ids = []
@@ -163,7 +163,7 @@ def plan(
163163
"""Check the difference between a local file and dbt Cloud without updating dbt Cloud.
164164
This command will not update dbt Cloud.
165165
166-
CONFIG is the path to your jobs.yml config file or a glob pattern for those files.
166+
CONFIG is the path to your YML jobs config file (also supports glob patterns for those files or a directory).
167167
"""
168168
cloud_project_ids = []
169169
cloud_environment_ids = []
@@ -211,7 +211,7 @@ def plan(
211211
def validate(config, vars_yml, online, disable_ssl_verification):
212212
"""Check that the config file is valid
213213
214-
CONFIG is the path to your jobs.yml config file or a glob pattern for those files.
214+
CONFIG is the path to your YML jobs config file (also supports glob patterns for those files or a directory).
215215
"""
216216
try:
217217
config_files, vars_files = resolve_file_paths(config, vars_yml)
@@ -305,7 +305,7 @@ def validate(config, vars_yml, online, disable_ssl_verification):
305305
@click.option(
306306
"--config",
307307
type=str,
308-
help="The path to your YML jobs config file (or pattern for those files).",
308+
help="The path to your YML jobs config file (also supports glob patterns for those files or a directory).",
309309
)
310310
@click.option("--account-id", type=int, help="The ID of your dbt Cloud account.")
311311
@option_project_ids

0 commit comments

Comments
 (0)