#!/bin/bash

# Function to fetch config and extract BID
fetch_bid() {
    local result
    result=$(bumpver show -n --environ)

    echo "$result" | grep "^BID=" | cut -d'=' -f2
}

build=$(fetch_bid)
next_build=$((build + 1))

path="fastlane/metadata/android/en-US/changelogs/${next_build}.txt"

touch "./${path}"

echo "Added changelog for next build (${next_build})"
echo "./${path}"

exec code "$path"
