UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

19 lines (16 loc) 539 B
import { getGitTags } from './chunk-J74HALEO.mjs'; import './chunk-TRN6YLKQ.mjs'; import './chunk-UFOKMNUE.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 };