> ## Documentation Index
> Fetch the complete documentation index at: https://docs.directgvr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use include and exclude filters

> Deploy only some of the files in a source folder with the include and exclude filters.

The `include` and `exclude` options let you deploy a chosen set of files and folders from a larger source folder. They were added in DIRECT 6.0.2.41 and its deployment scripts.

## How filters work

* `exclude`: files and folders to leave out.
* `include`: files and folders to deploy. Everything else is ignored.
* `*` is a wildcard and `!` negates a wildcard.
* Separate entries with a semicolon (`;`).
* Paths are relative to the `source` path.
* If a file matches both, `exclude` wins.

> [!NOTE]
>
> The tools don't search your source path for every file in your filters, so missing files or folders don't cause an error. They're ignored and the deployment continues.

Set filters on the command line or in a JSON configuration file:

```bash theme={null}
release_deploy.py --repository=llama-game --source=C:\SSN\llama_game\releases\33\ --exclude=languages/*;config.ini --version=1.00.033 --sync_directory=<your-sync-directory>/ --base_url=https://<your-delivery-host>/<path>/
```

```json theme={null}
{
  "repository": "llama-game",
  "source": "C:/SSN/llama_game/releases/33/",
  "exclude": "languages/*;config.ini",
  "version": "1.00.033",
  "sync_directory": "<your-sync-directory>/",
  "base_url": "https://<your-delivery-host>/<path>/"
}
```

## Examples

| Goal | Filter |
| - | - |
| Leave out the `languages` folder | `--exclude=languages/*` |
| Leave out everything in `languages` except `en-us.json` | `--exclude=languages/*;!languages/en-us.json` |
| Deploy only `.jpg` files, in any folder | `--include=*.jpg` |
| Deploy only some folders and files starting with `file` (quotes because a folder name has a space) | `--include="dedicated server/*;dlc/*;file*"` |
| Deploy the `dlc` folder except its `gotham` subfolder | `--include=dlc/* --exclude=dlc/gotham/*` |
| The same, with negation | `--include=dlc/*;!dlc/gotham/*` |

## Check the result

Open the release's metafile from the `sync_directory` you deployed to. `release_deploy.py` shows where it copied the metafile:

```text theme={null}
02/05/2021 23:17:44 - Copying metafile to D:/ssn/deployscripts/output/ultra-filter-5/metafile/b6cc36b67399ca2392777c9b0b859f0afafe16c2/metafile.json
```

If the metafile is signed, decode it with a tool such as [jwt.io](https://jwt.io/). The `files` section lists the files in the release:

```json theme={null}
"id": "b6cc36b67399ca2392777c9b0b859f0afafe16c2",
"files": [
  { "name": "dlc/batman.jpg", "size": 125836 },
  { "name": "dlc/readme.md", "size": 21883 },
  { "name": "dlc/shire/hobbitdwellings.txt", "size": 12582912 }
],
```

## Related

* [Deploy a release](https://docs.directgvr.com/release-automation/deploy-a-release.md)
* [Deployment scripts](https://docs.directgvr.com/release-automation/deployment-scripts.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.