@sap-ux/project-access 1.32.4 → 1.32.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -154,7 +154,16 @@ async function convertDistTagToVersion(distTag, options) {
|
|
|
154
154
|
logger?.debug(`Specification dist-tags not found at '${specificationDistTagPath}'. Trying to refresh.`);
|
|
155
155
|
await refreshSpecificationDistTags({ logger });
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
let specificationDistTags = await (0, file_1.readJSON)(specificationDistTagPath);
|
|
158
|
+
// Validate the current dist-tags file
|
|
159
|
+
if ('error' in specificationDistTags &&
|
|
160
|
+
!(distTag in specificationDistTags) &&
|
|
161
|
+
!('latest' in specificationDistTags)) {
|
|
162
|
+
// Refresh if dist-tags are invalid
|
|
163
|
+
logger?.debug(`Specification dist-tags file has error at '${specificationDistTagPath}'. Trying to refresh.`);
|
|
164
|
+
await refreshSpecificationDistTags({ logger });
|
|
165
|
+
specificationDistTags = await (0, file_1.readJSON)(specificationDistTagPath);
|
|
166
|
+
}
|
|
158
167
|
const version = specificationDistTags[distTag] ?? specificationDistTags.latest;
|
|
159
168
|
return version;
|
|
160
169
|
}
|