1import { getHeadGitSha } from './gitRepoF.mts'2import { epsToPathsGitCached } from '../../dockerF/dfFromMadgeF.mts'3import { absPathToPtPath } from '../../../serverF/pathF/absPathToPtPathF.mts'4import { getImportMetaUrlPath } from '../../../serverF/isDirectlyRunF.mts'6type GetDeployGitShaOpts = {7 importMetaUrl: string8 appSourcePaths?: string[]9}11export const getDeployGitSha = async ({importMetaUrl, appSourcePaths = []}: GetDeployGitShaOpts) => {12 const deployEpPath = absPathToPtPath(getImportMetaUrlPath(importMetaUrl) as any)13 const deployPathsA = await epsToPathsGitCached({epPtPathsA: [deployEpPath]})14 const filterPathList = [...deployPathsA, ...appSourcePaths]15 return getHeadGitSha({filterPathList})16}