mod-build 4.0.0-alpha.20e → 4.0.0-alpha.20f
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.
- package/package.json +1 -1
- package/tasks/templates.js +11 -15
package/package.json
CHANGED
package/tasks/templates.js
CHANGED
|
@@ -75,22 +75,18 @@ const fetchTcpaFromSitegenie = async (config, tempConfig) => {
|
|
|
75
75
|
|
|
76
76
|
console.log('Starting fetch-tcpa-from-sitegenie: ', url);
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
78
|
+
axios.get(url).then(async resp => {
|
|
79
|
+
if (resp.status !== 200) {
|
|
80
|
+
throw new Error(`${resp.status}: Error while fetching TCPA`);
|
|
81
|
+
}
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
console.error(error);
|
|
92
|
-
resolve();
|
|
93
|
-
});
|
|
83
|
+
const responseJson = resp.data;
|
|
84
|
+
let finalTCPA = await (company === 'Modernize' || config.useModernizeInTCPA) ? responseJson.tcpa.replace(/QuinStreet/g, 'Modernize') : responseJson.tcpa;
|
|
85
|
+
const removeInlineStyleRegex = / style="[^"]*"/g;
|
|
86
|
+
finalTCPA = finalTCPA.replace(removeInlineStyleRegex, '');
|
|
87
|
+
tempConfig.tcpaText = await finalTCPA;
|
|
88
|
+
}).catch(error => {
|
|
89
|
+
console.error(error);
|
|
94
90
|
});
|
|
95
91
|
};
|
|
96
92
|
|