Force all dev builds to use assets.dev.json

This commit is contained in:
Raymond Hill 2023-05-08 08:23:19 -04:00
parent f6839f5a57
commit fd821e3473
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 12 additions and 2 deletions

View File

@ -815,7 +815,7 @@ const getRemote = async function(assetKey) {
const assetDetails = assetRegistry[assetKey] || {};
const reportBack = function(content, err) {
const details = { assetKey: assetKey, content: content };
const details = { assetKey, content };
if ( err ) {
details.error = assetDetails.lastError = err;
} else {
@ -851,9 +851,19 @@ const getRemote = async function(assetKey) {
}
}
for ( const contentURL of contentURLs ) {
for ( let contentURL of contentURLs ) {
if ( reIsExternalPath.test(contentURL) === false ) { continue; }
// This will force uBO to fetch the proper version according to whether
// the dev build is being used. This can be removed when execution of
// this code path is widespread for dev build revisions of uBO.
if ( assetKey === 'assets.json' ) {
contentURL = contentURL.replace(
/\/assets\/assets\.json$/,
µb.assetsJsonPath
);
}
const result = assetDetails.content === 'filters'
? await assets.fetchFilterList(contentURL)
: await assets.fetchText(contentURL);