@edgedev/firebase 2.0.15 → 2.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/postinstall.sh +7 -13
package/package.json
CHANGED
package/src/postinstall.sh
CHANGED
|
@@ -22,14 +22,17 @@ awk '/\/\/ #EDGE FIREBASE RULES START/,/\/\/ #EDGE FIREBASE RULES END/' ./src/fi
|
|
|
22
22
|
sed -e '1s/^/\/\/ #EDGE FIREBASE RULES START\n/' -e '$s/$/\n\/\/ #EDGE FIREBASE RULES END/' \
|
|
23
23
|
>> "$project_root/firestore.rules";
|
|
24
24
|
|
|
25
|
-
if [ ! -
|
|
26
|
-
mkdir
|
|
27
|
-
echo "require('dotenv').config({ path: process.env.NODE_ENV === 'production' ? '.env.prod' : '.env.dev' })" > "$project_root/functions/index.js";
|
|
25
|
+
if [ ! -d "$project_root/functions" ]; then
|
|
26
|
+
mkdir "$project_root/functions"
|
|
28
27
|
fi
|
|
29
28
|
|
|
30
29
|
cp ./src/edgeFirebase.js "$project_root/functions/edgeFirebase.js"
|
|
31
30
|
cp ./src/config.js "$project_root/functions/config.js"
|
|
32
31
|
|
|
32
|
+
if [ ! -f "$project_root/functions/index.js" ]; then
|
|
33
|
+
cp ./src/.env.dev "$project_root/functions/index.js"
|
|
34
|
+
fi
|
|
35
|
+
|
|
33
36
|
if [ ! -f "$project_root/functions/.env.dev" ]; then
|
|
34
37
|
cp ./src/.env.dev "$project_root/functions/.env.dev"
|
|
35
38
|
fi
|
|
@@ -51,13 +54,4 @@ if [ ! -f "$project_root/functions/package.json" ]; then
|
|
|
51
54
|
cd "$project_root/functions"
|
|
52
55
|
npm install --no-audit --silent
|
|
53
56
|
cd "$project_root"
|
|
54
|
-
fi
|
|
55
|
-
|
|
56
|
-
[ "$(tail -c1 $project_root/functions/index.js)" != "" ] && echo "" >> "$project_root/functions/index.js"
|
|
57
|
-
|
|
58
|
-
sed -i.backup '/\/\/ START @edge\/firebase functions/,/\/\/ END @edge\/firebase functions/d' "$project_root/functions/index.js"
|
|
59
|
-
|
|
60
|
-
awk '/\/\/ START @edge\/firebase functions/,/\/\/ END @edge\/firebase functions/' ./src/functions.js | \
|
|
61
|
-
sed '1d;$d' | \
|
|
62
|
-
sed -e '1s/^/\/\/ START @edge\/firebase functions\n/' -e '$s/$/\n\/\/ END @edge\/firebase functions/' \
|
|
63
|
-
>> "$project_root/functions/index.js";
|
|
57
|
+
fi
|