|
| 1 | +# update |
| 2 | + |
| 3 | +Update pace to the latest version. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +```bash |
| 8 | +pace update |
| 9 | +``` |
| 10 | + |
| 11 | +## Description |
| 12 | + |
| 13 | +The `update` command automatically updates pace to the latest version available on GitHub. The command intelligently detects your installation method and uses the appropriate update mechanism. |
| 14 | + |
| 15 | +## Installation Method Detection |
| 16 | + |
| 17 | +Pace automatically detects how it was installed and updates accordingly: |
| 18 | + |
| 19 | +### Winget (Windows) |
| 20 | + |
| 21 | +If pace was installed via Winget, the command runs: |
| 22 | + |
| 23 | +```bash |
| 24 | +winget upgrade Azuyamat.Pace |
| 25 | +``` |
| 26 | + |
| 27 | +### Go Install |
| 28 | + |
| 29 | +If pace was installed via `go install`, the command runs: |
| 30 | + |
| 31 | +```bash |
| 32 | +go install github.com/azuyamat/pace/cmd/pace@latest |
| 33 | +``` |
| 34 | + |
| 35 | +### Direct Installation |
| 36 | + |
| 37 | +If pace was installed by downloading the binary directly (via curl, wget, or manual download), the command: |
| 38 | + |
| 39 | +1. Downloads the latest release from GitHub |
| 40 | +2. Extracts the binary from the archive |
| 41 | +3. Safely replaces the current binary with a backup mechanism |
| 42 | + |
| 43 | +## Examples |
| 44 | + |
| 45 | +### Check and Update |
| 46 | + |
| 47 | +```bash |
| 48 | +$ pace update |
| 49 | +Checking for updates... |
| 50 | +Updating from 1.0.0 to 1.1.0... |
| 51 | +Proceeding with self-update... |
| 52 | + |
| 53 | +Successfully updated to version 1.1.0 |
| 54 | +Restart pace to use the new version |
| 55 | +``` |
| 56 | + |
| 57 | +### Already Up to Date |
| 58 | + |
| 59 | +```bash |
| 60 | +$ pace update |
| 61 | +Checking for updates... |
| 62 | +Already on latest version: 1.1.0 |
| 63 | +``` |
| 64 | + |
| 65 | +### Winget Installation |
| 66 | + |
| 67 | +```bash |
| 68 | +$ pace update |
| 69 | +Checking for updates... |
| 70 | +Updating from 1.0.0 to 1.1.0... |
| 71 | +Running: winget upgrade Azuyamat.Pace |
| 72 | +[winget output] |
| 73 | +Update completed successfully! |
| 74 | +``` |
| 75 | + |
| 76 | +### Go Installation |
| 77 | + |
| 78 | +```bash |
| 79 | +$ pace update |
| 80 | +Checking for updates... |
| 81 | +Updating from 1.0.0 to 1.1.0... |
| 82 | +Running: go install github.com/azuyamat/pace/cmd/pace@latest |
| 83 | +[go install output] |
| 84 | +Update completed successfully! |
| 85 | +``` |
| 86 | + |
| 87 | +## How It Works |
| 88 | + |
| 89 | +1. **Check for Updates**: Queries the GitHub API for the latest release |
| 90 | +2. **Compare Versions**: Compares your current version with the latest |
| 91 | +3. **Detect Installation Method**: Determines how pace was installed |
| 92 | +4. **Execute Update**: Runs the appropriate update mechanism |
| 93 | +5. **Verify**: Confirms the update was successful |
| 94 | + |
| 95 | +## Safety Features |
| 96 | + |
| 97 | +For direct installations, the update process includes: |
| 98 | + |
| 99 | +- **Backup Creation**: The old binary is backed up before replacement |
| 100 | +- **Rollback on Failure**: If the update fails, the backup is restored |
| 101 | +- **Permission Checks**: Verifies write permissions before attempting update |
| 102 | + |
| 103 | +## Platform Support |
| 104 | + |
| 105 | +The update command works on: |
| 106 | + |
| 107 | +- **Windows** (amd64, arm64) |
| 108 | +- **Linux** (amd64, arm64) |
| 109 | +- **macOS** (amd64, arm64) |
| 110 | + |
| 111 | +## Troubleshooting |
| 112 | + |
| 113 | +### Permission Denied |
| 114 | + |
| 115 | +If you get a permission error: |
| 116 | + |
| 117 | +- **Linux/macOS**: You may need to run with `sudo` if the binary is in a protected directory |
| 118 | +- **Windows**: Run your terminal as Administrator if installed in Program Files |
| 119 | + |
| 120 | +### Update Command Not Available |
| 121 | + |
| 122 | +If Winget or Go is detected but the command fails: |
| 123 | + |
| 124 | +- Ensure `winget` or `go` is installed and available in your PATH |
| 125 | +- Verify you have an active internet connection |
| 126 | + |
| 127 | +### Manual Update |
| 128 | + |
| 129 | +If the automatic update fails, you can always: |
| 130 | + |
| 131 | +1. Download the latest release from [GitHub Releases](https://github.com/azuyamat/pace/releases) |
| 132 | +2. Extract the binary |
| 133 | +3. Replace your current pace binary |
| 134 | + |
| 135 | +## See Also |
| 136 | + |
| 137 | +- [version](./version.md) - Check your current version |
| 138 | +- [Installation](../installation.md) - Installation methods |
0 commit comments