UNPKG

@alaudoni/expo-firebase-extension-plugin

Version:

The Firebase Expo plugin allows you to use Firebase without leaving the managed workflow. Developed in collaboration with SweetGreen.

25 lines (24 loc) 1.03 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.updatePodfile = updatePodfile; const fs_1 = __importDefault(require("fs")); const iosConstants_1 = require("./iosConstants"); const FirebaseLog_1 = require("./FirebaseLog"); const FileManager_1 = require("./FileManager"); async function updatePodfile(iosPath) { const podfile = await FileManager_1.FileManager.readFile(`${iosPath}/Podfile`); const matches = podfile.match(iosConstants_1.NSE_PODFILE_REGEX); if (matches) { FirebaseLog_1.FirebaseLog.log("FirebaseNotificationServiceExtension target already added to Podfile. Skipping..."); } else { fs_1.default.appendFile(`${iosPath}/Podfile`, iosConstants_1.NSE_PODFILE_SNIPPET, (err) => { if (err) { FirebaseLog_1.FirebaseLog.error("Error writing to Podfile"); } }); } }