mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Revert "[LOCAL] Add more logging around computeNightlyTarballURL"
This reverts commit 1a6887bd70.
This commit is contained in:
@@ -65,13 +65,10 @@ async function computeNightlyTarballURL(
|
||||
artifactCoordinate /*: string */,
|
||||
artifactName /*: string */,
|
||||
) /*: Promise<string> */ {
|
||||
const urlLog = createLogger('NightlyURL');
|
||||
const xmlUrl = `https://central.sonatype.com/repository/maven-snapshots/com/facebook/react/${artifactCoordinate}/${version}-SNAPSHOT/maven-metadata.xml`;
|
||||
|
||||
urlLog(`Attempting to download maven-metadata.xml from: ${xmlUrl}...`);
|
||||
const response = await fetch(xmlUrl);
|
||||
if (!response.ok) {
|
||||
urlLog(`Downloading maven-metadata.xml failed!`, 'error');
|
||||
return '';
|
||||
}
|
||||
const xmlText = await response.text();
|
||||
@@ -79,7 +76,6 @@ async function computeNightlyTarballURL(
|
||||
// Extract the <snapshot> block
|
||||
const snapshotMatch = xmlText.match(/<snapshot>([\s\S]*?)<\/snapshot>/);
|
||||
if (!snapshotMatch) {
|
||||
urlLog(`Could not find a <snapshot> tag that matches the regex!`, 'error');
|
||||
return '';
|
||||
}
|
||||
const snapshotContent = snapshotMatch[1];
|
||||
@@ -87,7 +83,6 @@ async function computeNightlyTarballURL(
|
||||
// Extract <timestamp> from the snapshot block
|
||||
const timestampMatch = snapshotContent.match(/<timestamp>(.*?)<\/timestamp>/);
|
||||
if (!timestampMatch) {
|
||||
urlLog(`Could not find a <timestamp> tag inside <snapshot> that matches the regex!`, 'error');
|
||||
return '';
|
||||
}
|
||||
const timestamp = timestampMatch[1];
|
||||
@@ -97,14 +92,12 @@ async function computeNightlyTarballURL(
|
||||
/<buildNumber>(.*?)<\/buildNumber>/,
|
||||
);
|
||||
if (!buildNumberMatch) {
|
||||
urlLog(`Could not find a <buildNumber> tag that matches the regex!`, 'error');
|
||||
return '';
|
||||
}
|
||||
const buildNumber = buildNumberMatch[1];
|
||||
|
||||
const fullVersion = `${version}-${timestamp}-${buildNumber}`;
|
||||
const finalUrl = `https://central.sonatype.com/repository/maven-snapshots/com/facebook/react/${artifactCoordinate}/${version}-SNAPSHOT/${artifactCoordinate}-${fullVersion}-${artifactName}`;
|
||||
urlLog(`Final artifact URL found: ${finalUrl}`);
|
||||
return finalUrl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user