# Deploy from a script

Source: https://uglydev.com/docs/how-do-i-git-and-deploys/deploy-from-a-script-2/
Updated: 20 November 2026

**You want:** a deploy that updates the fields **without anyone opening the admin**.

```bash
set -e
git pull
wp ugly-fields check     # stops here if a file is broken
wp ugly-fields upgrade   # stored data up to date
wp ugly-fields sync      # the saved groups take the files
```

| Command | What it does |
| --- | --- |
| `check` | Reads every JSON of the theme and fails if one is not valid |
| `upgrade` | Brings the stored data up to date |
| `sync` | The saved groups take what the files say |

> **Why set -e:** With `set -e` at the top, a broken file **stops the deploy before sync can run**: the site keeps the groups it had.

> **Pro:** `wp ugly-fields` is part of UglyFields Pro. Without it, **Sync** in the admin does the same by hand.
