Skip to content

Commit 0e00cdc

Browse files
committed
fix(analytics): hook multiple writes
1 parent c4ae70f commit 0e00cdc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/firebase-analytics/hooks/before-checkForChanges.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export = function ($logger, $projectData, hookArgs) {
1515
const resourcePodData = fs.readFileSync(ResourcePodfile, 'utf8');
1616

1717
// set variable early in the Podfile
18-
if (podData && resourcePodData && resourcePodData.indexOf('$NSFirebaseAnalyticsWithoutAdIdSupport=true') > -1) {
18+
19+
if (podData && resourcePodData && resourcePodData.indexOf('$NSFirebaseAnalyticsWithoutAdIdSupport=true') > -1 && podData.indexOf('$NSFirebaseAnalyticsWithoutAdIdSupport=true') !== 0) {
1920
fs.writeFileSync(Podfile, '$NSFirebaseAnalyticsWithoutAdIdSupport=true \n' + podData);
2021
}
2122
}

0 commit comments

Comments
 (0)