@techmely/utils
Version:
Collection of helpful JavaScript / TypeScript utils
28 lines (24 loc) • 559 B
JavaScript
/*!
* @techmely/utils
* Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com>
* MIT Licensed
*/
import {
getGitTags
} from "./chunk-ZR6MO2VH.js";
import {
findLastIndex
} from "./chunk-5Z5ETKJZ.js";
// 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
};