Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function updateProjectManifest(applicationId) {
console.log('Updating manifest with application ID');
try {
// Update manifest with application guid and unique manifest id
const manifestContent = await fs.readFileSync(defaults.manifestPath, 'utf8');
const re = new RegExp('{application GUID here}', 'g');
const updatedManifestContent = manifestContent.replace(re, applicationId);
await fs.writeFileSync(defaults.manifestPath, updatedManifestContent);
await manifest.modifyManifestFile(defaults.manifestPath, 'random');
} catch (err) {
throw new Error(`Unable to update ${defaults.manifestPath}. \n${err}`);
}
}