# Ghost CLI installs wrong minor version

### Summary

The Ghost CLI allows for updating (and installing) specific versions/tags of Ghost. It is possible to provide them with `v` as a prefix, or without, as well as only providing the major version or the major and minor versions, omitting the patch version.  
If the minor version is a multiple of 10 (10, 20, ...), having at least 2 digits and ending in `0`, the wrong version gets installed. The 2 digits are split, and the first is used as the minor version and the `0` as the patch version.

### Steps to Reproduce

1. Have a Ghost install  
    Preferably, with version &lt;5.20, so the `--force` flag doesn't need to be used
    
2. Run `ghost update` and provide a specific version, that has a minor version of a multiple of 10 and don't provide the patch version, like `ghost update 5.20`
    
3. Observe, that Ghost version 5.2.0 is getting installed
    

CLI command `ghost update 5.20` log:

```bash
$ ghost update 5.20

Love open source? We’re hiring JavaScript Engineers to work on Ghost full-time.
https://careers.ghost.org

Running in development mode

✔ Checking system Node.js version - found v16.18.1
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking memory availability
✔ Checking free space
✔ Checking for available migrations
✔ Checking for latest Ghost version
✔ Release notes were not found
✔ Downloading and updating Ghost to v5.2.0
✔ Linking latest Ghost and recording versions
✔ Removing old Ghost versions
ghost update 5.20  15.27s user 9.01s system 137% cpu 17.708 total
```

<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Like with <code>ghost update 5.21</code>, it should install the correct minor version. Preferably, with the current patch version.</div>
</div>

---

GitHub issue:

%[https://github.com/TryGhost/Ghost-CLI/issues/1713] 

### Workarounds, tips and hints

Specify the full version including the patch version, like: `ghost update v5.22.10`
