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

Commit 355d43f

Browse files
Switch to prompt-lite (which has way less dependencies)
1 parent 032f64d commit 355d43f

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

scripts/postinstall.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var fs = require('fs');
22
var path = require('path');
3-
var prompt = require('prompt');
3+
var prompt = require('prompt-lite');
44

55
// Default settings for using ios and android with Firebase
66
var usingiOS = false, usingAndroid = false;
@@ -133,6 +133,7 @@ function promptQuestions() {
133133
function promptQuestionsResult(result) {
134134
if(usingiOS) {
135135
writePodFile(result);
136+
// writeIOSEntitlementsCopyHook();
136137
}
137138
if(usingAndroid) {
138139
writeGradleFile(result);
@@ -156,6 +157,29 @@ function askSaveConfigPrompt() {
156157
});
157158
}
158159

160+
// "scripts/install_ios_entitlements.js"
161+
function writeIOSEntitlementsCopyHook() {
162+
console.log("Install ios-entitlements installation hook.");
163+
try {
164+
var scriptContent = "module.exports = require(\"nativescript-plugin-firebase/scripts/install_ios_entitlements.js\");";
165+
166+
var scriptPath = path.join(appRoot, "hooks", "after-prepare", "run_ios_entitlements_install_script.js");
167+
var afterPrepareDirPath = path.dirname(scriptPath);
168+
var hooksDirPath = path.dirname(afterPrepareDirPath);
169+
if (!fs.existsSync(afterPrepareDirPath)) {
170+
if (!fs.existsSync(hooksDirPath)) {
171+
fs.mkdirSync(hooksDirPath);
172+
}
173+
fs.mkdirSync(afterPrepareDirPath);
174+
}
175+
fs.writeFileSync(scriptPath, scriptContent);
176+
177+
} catch(e) {
178+
console.log("Failed to install ios-entitlements installation hook.");
179+
console.log(e);
180+
}
181+
}
182+
159183
/**
160184
* Create the iOS PodFile for installing the Firebase iOS dependencies and service dependencies
161185
*

0 commit comments

Comments
 (0)