import { getGitTags } from './chunk-AMYSF5SC.mjs';
import './chunk-7PK2OC72.mjs';
import './chunk-FQAHUYD7.mjs';
import { findLastIndex } from './chunk-R4AZFFAM.mjs';
import './chunk-NYLAFCGV.mjs';

// src/getAppVersion.ts
async function getAppVersion(pkgName) {
  const tags = await getGitTags();
  const tag = findLastIndex(tags, (tag2) => tag2.startsWith(pkgName));
  if (tag === -1) {
    throw new Error("Your app(s) doesnt have any tag");
  }
  const version = tags[tag].split("@")[1];
  return version;
}

export { getAppVersion };
