mod-build 4.0.0-alpha.11 → 4.0.0-alpha.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.0-alpha.11",
3
+ "version": "4.0.0-alpha.12",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -63,7 +63,7 @@ const getDefaultFormFieldConfig = async (config, folder = 'accessible-components
63
63
 
64
64
  };
65
65
 
66
- const fetchTcpaFromSitegenie = async (config) => {
66
+ const fetchTcpaFromSitegenie = async (config, tempConfig) => {
67
67
  const company = config.company_name;
68
68
  const website = config.website_name;
69
69
  const c_level = config.cLevel || 'default';
@@ -85,7 +85,7 @@ const fetchTcpaFromSitegenie = async (config) => {
85
85
  let finalTCPA = await (company === 'Modernize' || config.useModernizeInTCPA) ? responseJson.tcpa.replace(/QuinStreet/g, 'Modernize') : responseJson.tcpa;
86
86
  const removeInlineStyleRegex = / style="[^"]*"/g;
87
87
  finalTCPA = finalTCPA.replace(removeInlineStyleRegex, '');
88
- config.tcpaText = await finalTCPA;
88
+ tempConfig.tcpaText = await finalTCPA;
89
89
  resolve();
90
90
  }).catch(error => {
91
91
  console.error(error);
@@ -127,14 +127,15 @@ export default async function(config) {
127
127
  }
128
128
  }
129
129
  if (!config.tcpaText && config.primary_trade && !tempConfigCreated) {
130
- await fetchTcpaFromSitegenie(config);
130
+ await fetchTcpaFromSitegenie(config, tempConfig);
131
131
  }
132
132
  }
133
133
 
134
- if (!fs.existsSync(`${defaultSettings.srcFolder}/${defaultSettings.tmpFolder}`)) {
135
- fs.mkdirSync(`${defaultSettings.srcFolder}/${defaultSettings.tmpFolder}`, { recursive: true });
136
- }
137
-
138
- fs.writeFileSync(`${defaultSettings.srcFolder}/${defaultSettings.tmpFolder}/config.json`, JSON.stringify(tempConfig, null, 2));
134
+ if (!tempConfigCreated) {
135
+ if (!fs.existsSync(`${defaultSettings.srcFolder}/${defaultSettings.tmpFolder}`)) {
136
+ fs.mkdirSync(`${defaultSettings.srcFolder}/${defaultSettings.tmpFolder}`, { recursive: true });
137
+ }
139
138
 
139
+ fs.writeFileSync(`${defaultSettings.srcFolder}/${defaultSettings.tmpFolder}/config.json`, JSON.stringify(tempConfig, null, 2));
140
+ }
140
141
  }