Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit dafa78f

Browse files
Basic integration of Crashlytics for iOS... #549 (remove the dSYM hook in case Crashlytics is disabled)
1 parent 3fd5867 commit dafa78f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

publish/scripts/installer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,15 @@ pod 'Firebase/Auth'
286286
* @param {any} enable Is Crashlytics enbled
287287
*/
288288
function writeBuildscriptHook(enable) {
289+
var scriptPath = path.join(appRoot, "hooks", "after-prepare", "firebase-crashlytics-buildscript.js");
290+
289291
if (!enable) {
292+
if (fs.existsSync(scriptPath)) {
293+
fs.unlinkSync(scriptPath);
294+
}
290295
return
291296
}
297+
292298
console.log("Install Crashlytics buildscript hook.");
293299
try {
294300
var scriptContent =
@@ -410,7 +416,6 @@ module.exports = function($logger, $projectData, hookArgs) {
410416
});
411417
};
412418
`;
413-
var scriptPath = path.join(appRoot, "hooks", "after-prepare", "firebase-crashlytics-buildscript.js");
414419
var afterPrepareDirPath = path.dirname(scriptPath);
415420
var hooksDirPath = path.dirname(afterPrepareDirPath);
416421
if (!fs.existsSync(afterPrepareDirPath)) {

src/scripts/postinstall.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3084,9 +3084,15 @@ pod 'Firebase/Auth'
30843084
* @param {any} enable Is Crashlytics enbled
30853085
*/
30863086
function writeBuildscriptHook(enable) {
3087+
var scriptPath = path.join(appRoot, "hooks", "after-prepare", "firebase-crashlytics-buildscript.js");
3088+
30873089
if (!enable) {
3090+
if (fs.existsSync(scriptPath)) {
3091+
fs.unlinkSync(scriptPath);
3092+
}
30883093
return
30893094
}
3095+
30903096
console.log("Install Crashlytics buildscript hook.");
30913097
try {
30923098
var scriptContent =
@@ -3208,7 +3214,6 @@ module.exports = function($logger, $projectData, hookArgs) {
32083214
});
32093215
};
32103216
`;
3211-
var scriptPath = path.join(appRoot, "hooks", "after-prepare", "firebase-crashlytics-buildscript.js");
32123217
var afterPrepareDirPath = path.dirname(scriptPath);
32133218
var hooksDirPath = path.dirname(afterPrepareDirPath);
32143219
if (!fs.existsSync(afterPrepareDirPath)) {

0 commit comments

Comments
 (0)