35 lines
1.2 KiB
PowerShell
35 lines
1.2 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
|
|
$root = Split-Path -Parent $PSScriptRoot
|
|
$avatar = Get-Content -LiteralPath (Join-Path $root 'utils/avatar.js') -Raw -Encoding UTF8
|
|
$component = Get-Content -LiteralPath (Join-Path $root 'components/AppAvatar.vue') -Raw -Encoding UTF8
|
|
|
|
foreach ($required in @(
|
|
'DEFAULT_MALE_AVATAR',
|
|
'mjpc0703_A_cartoon_illustration_of_a_boy_wearing_a_red_Chinese__0@2x.png',
|
|
'DEFAULT_FEMALE_AVATAR',
|
|
'loyel003_Ancient_Beauty_Wearing_Tang_Dynasty_ClothingLooking_to_07cb98a9-ec37-4620-a032-ebe511fa93b5@2x.png',
|
|
'String(sex ?? "").trim() === "1"'
|
|
)) {
|
|
if (-not $avatar.Contains($required)) {
|
|
throw "Default avatar contract missing: $required"
|
|
}
|
|
}
|
|
|
|
if (-not $component.Contains('getDefaultAvatar(props.sex)')) {
|
|
throw 'AppAvatar must own the fallback-avatar selection'
|
|
}
|
|
|
|
foreach ($page in @(
|
|
'pages/tree/t01-tree-overview.vue',
|
|
'pages/tree/t03-member-profile.vue',
|
|
'pages/profile/m01-profile-home.vue'
|
|
)) {
|
|
$source = Get-Content -LiteralPath (Join-Path $root $page) -Raw -Encoding UTF8
|
|
if (-not $source.Contains('import AppAvatar from "@/components/AppAvatar.vue"')) {
|
|
throw "Shared avatar component is not wired in: $page"
|
|
}
|
|
}
|
|
|
|
Write-Output 'DEFAULT-AVATAR-CONTRACT PASS'
|