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.

20 lines (17 loc) 660 B
import fs from 'fs'; import { NSE_PODFILE_REGEX, NSE_PODFILE_SNIPPET } from './iosConstants'; import { FirebaseLog } from './FirebaseLog'; import { FileManager } from './FileManager'; export async function updatePodfile(iosPath: string) { const podfile = await FileManager.readFile(`${iosPath}/Podfile`); const matches = podfile.match(NSE_PODFILE_REGEX); if (matches) { FirebaseLog.log("FirebaseNotificationServiceExtension target already added to Podfile. Skipping..."); } else { fs.appendFile(`${iosPath}/Podfile`, NSE_PODFILE_SNIPPET, (err) => { if (err) { FirebaseLog.error("Error writing to Podfile"); } }) } }