Closed fireball8931 closed 1 month ago
Merging to main
in this repository is managed by Trunk.
/trunk merge
below.Risk Level 3 - /home/runner/work/ascentiaci.ca/ascentiaci.ca/scripts/injectBrand.js
The try-catch block added around the file read and write operations is a good practice for error handling. However, the removal of the actual file read and write operations is concerning as it might break the functionality. Ensure that the file operations are still performed within the try block.
The brand
variable is used in the console log but is not defined within the scope of the try-catch block. Ensure that brand
is accessible or passed correctly.
The pagesToUpdate
array and the subsequent loop to call replaceOrPrependLocals
is a good addition for scalability. However, ensure that the paths are correct and accessible.
The removal of the SCSS content update logic might break the styling updates. Ensure that this logic is either moved or replaced appropriately.
Example of fixing the file read and write operations within the try block:
try {
let fileContent = fs.readFileSync(fileLocation, \"utf8\");
const startLocals = \"<!-- START LOCALS -->\";
const endLocals = \"<!-- END LOCALS -->\";
const startIndex = fileContent.indexOf(startLocals);
const endIndex = fileContent.indexOf(endLocals) + endLocals.length;
if (startIndex === -1 || endIndex === -1) {
fileContent = newLocals + \"\
\" + fileContent;
} else {
fileContent = fileContent.slice(0, startIndex) + newLocals + fileContent.slice(endIndex);
}
fs.writeFileSync(fileLocation, fileContent, \"utf8\");
console.log(`✅ ${filePath} updated successfully with new Locals. ${brand} injected\
`);
} catch (error) {
console.error(`❌ Error updating ${filePath}:`, error);
}
🛠️📄⚠️
Latest commit: |
17e0e23
|
Status: | ✅ Deploy successful! |
Preview URL: | https://378d7210.elevareci-ca.pages.dev |
Branch Preview URL: | https://edits-june3.elevareci-ca.pages.dev |
Latest commit: |
17e0e23
|
Status: | ✅ Deploy successful! |
Preview URL: | https://c485659a.ascentiaci-ca.pages.dev |
Branch Preview URL: | https://edits-june3.ascentiaci-ca.pages.dev |
Linked to #45 Should build.
[ ] - Will need to add TM to the env variables