fix: registry incorrectly added to manifest when package testing

pull/263/head
Nic van Dessel 2024-03-14 09:54:35 -07:00
parent 9d8ff067a3
commit d77a456391
No known key found for this signature in database
GPG Key ID: 88AE94AD8B681486
1 changed files with 15 additions and 4 deletions

View File

@ -95,17 +95,28 @@ if [ "$PACKAGE_MODE" = "true" ]; then
fi
PACKAGE_MANIFEST_JSON=$(cat "$PACKAGE_MANIFEST_PATH")
echo "$PACKAGE_MANIFEST_JSON" | \
if [ -z "$SCOPED_REGISTRY_URL" || -z "$REGISTRY_SCOPES" ]; then
echo "$PACKAGE_MANIFEST_JSON" | \
jq \
--arg packageName "$PACKAGE_NAME" \
--arg projectPath "$UNITY_PROJECT_PATH" \
'.dependencies += {"com.unity.testtools.codecoverage": "1.1.1"} | .dependencies += {"\($packageName)": "file:\($projectPath)"} | . += {testables: ["\($packageName)"]}' \
> "$PACKAGE_MANIFEST_PATH"
else
echo "$PACKAGE_MANIFEST_JSON" | \
jq \
--arg packageName "$PACKAGE_NAME" \
--arg projectPath "$UNITY_PROJECT_PATH" \
--arg scopedRegistryUrl "$SCOPED_REGISTRY_URL" \
--argjson registryScopes "$(echo "[\"$REGISTRY_SCOPES\"]" | sed 's/,/","/g')" \
'.dependencies += {"com.unity.testtools.codecoverage": "1.1.1"} |
.dependencies += {"\($packageName)": "file:\($projectPath)"} |
. += {testables: ["\($packageName)"]} |
. += {scopedRegistries: [{"name":"dependency", "url":"\($scopedRegistryUrl)", scopes: $registryScopes}] }' \
.dependencies += {"\($packageName)": "file:\($projectPath)"} |
. += {testables: ["\($packageName)"]} |
. += {scopedRegistries: [{"name":"dependency", "url":"\($scopedRegistryUrl)", scopes: $registryScopes}] }' \
> "$PACKAGE_MANIFEST_PATH"
fi
UNITY_PROJECT_PATH="$TEMP_PROJECT_PATH"