You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds support for inferring a sub-package version by trying to
predict the sub-package tag using the current directory and Git root
path.
For example, running `svu` in a Go mono-repository with multiple
packages won't return the correct tag since it won't be able to parse
the latest tag `ansi/v0.1.2`.
This PR initializes the `--prefix` and `--pattern` when the current
directory doesn't match the Git root making `svu` work without the need
to specify `svu --prefix="ansi/v" --pattern="ansi/*" ...`.
P.S. maybe there's a cleaner way of doing so 🤔
Previously I had this little shell func
```sh
function get-next-version() {
root=$(git rev-parse --show-toplevel)
if [ "$PWD" != "$root" ]; then
local prefix=$(echo -n "$PWD" | sed "s|$root/||g")
svu --prefix="$prefix/v" --pattern="$prefix/*" "$@"
else
svu "$@"
fi
}
```
Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
0 commit comments