Skip to content

Commit

Permalink
Merge pull request #3088 from larsewi/windows
Browse files Browse the repository at this point in the history
ENT-10250, ENT-10490: Added warning against using glob patterns on Windows
  • Loading branch information
nickanderson authored Oct 31, 2023
2 parents 74b5f8c + f4af3d0 commit 10f2519
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions reference/functions/findfiles.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@ match all files in one directory that end in `.cf` but it won't search
across directories. `*/*.cf` on the other hand will look two levels
deep.
* `?` matches a single letter
* `[a-z]` matches any letter from `a` to `z` (not yet supported on Windows)
* `[a-z]` matches any letter from `a` to `z`

This function, used together with the `bundlesmatching` function,
allows you to do dynamic inputs and a dynamic bundle call chain.

**WARNING:**
- The current implementation of glob patterns on Windows contains bugs.
Therefore, we strongly recommend using the `!windows::` class guard
expression to safeguard against any use of the function on Windows platforms.
Rest assured, we are actively working on resolving these issues and improving
its functionality.

**Notes:**

- Brace expansion is not currently supported, `{x,y,anything}` will not match `x` or `y` or `anything`.
- Bracket expressions are currently not supported on Windows. `[a-z]` will be interpreted as its raw string representation on Windows.

**Example:**

Expand Down
10 changes: 8 additions & 2 deletions reference/functions/findfiles_up.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ shells:

* `*` matches any filename or directory
* `?` matches a single letter
* `[a-z]` matches any letter from `a` to `z` (not yet supported on Windows)
* `[a-z]` matches any letter from `a` to `z`

**WARNING:**
- The current implementation of glob patterns on Windows contains bugs.
Therefore, we strongly recommend using the `!windows::` class guard
expression to safeguard against any use of the function on Windows platforms.
Rest assured, we are actively working on resolving these issues and improving
its functionality.

**Notes:**

- Brace expansion is not currently supported, `{x,y,anything}` will not match `x` or `y` or `anything`.
- Bracket expressions are currently not supported on Windows. `[a-z]` will be interpreted as its raw string representation on Windows.

[%CFEngine_function_attributes(path, glob, level)%]

Expand Down

0 comments on commit 10f2519

Please sign in to comment.