@edgedev/firebase 1.7.9 → 1.7.10
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 +2 -2
- package/src/postinstall.sh +17 -0
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgedev/firebase",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.10",
|
|
4
4
|
"description": "Vue 3 / Nuxt 3 Plugin or Nuxt 3 plugin for firebase authentication and firestore.",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"postinstall": "
|
|
7
|
+
"postinstall": "bash ./scripts/postinstall.sh"
|
|
8
8
|
},
|
|
9
9
|
"author": "Seth Fischer",
|
|
10
10
|
"keywords": [
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Check if the destination file exists
|
|
4
|
+
if [ ! -f ./firestore.rules ]; then
|
|
5
|
+
# If the file does not exist, create it and add the rules_version line
|
|
6
|
+
echo 'rules_version = \'2\';' > ./firestore.rules;
|
|
7
|
+
else
|
|
8
|
+
# If the file exists, add the rules_version line at the beginning using sed
|
|
9
|
+
sed -i '1s/^/rules_version = \\'2\\';\\n/' ./firestore.rules;
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
# Extract the code block from the source file and append it to the destination file
|
|
13
|
+
awk '/\/\/ #EDGE FIREBASE RULES START/,/\/\/ #EDGE FIREBASE RULES END/' ./src/firestore.rules | \
|
|
14
|
+
sed 's/\\/\\\\/g; s/&/\\&/g' | \
|
|
15
|
+
sed -e 's/\"/\\\\\"/g' -e 's/\//\\\\\//g' | \
|
|
16
|
+
sed -e '1s/^/\/\/ #EDGE FIREBASE RULES START\n/' -e '$s/$/\n\/\/ #EDGE FIREBASE RULES END/' \
|
|
17
|
+
>> ./firestore.rules
|