@edgedev/firebase 2.0.15 → 2.0.16

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/postinstall.sh +5 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgedev/firebase",
3
- "version": "2.0.15",
3
+ "version": "2.0.16",
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": {
@@ -22,14 +22,13 @@ 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 [ ! -f "$project_root/functions/index.js" ]; then
26
- mkdir -p "$project_root/functions"
27
- echo "require('dotenv').config({ path: process.env.NODE_ENV === 'production' ? '.env.prod' : '.env.dev' })" > "$project_root/functions/index.js";
28
- fi
29
-
30
25
  cp ./src/edgeFirebase.js "$project_root/functions/edgeFirebase.js"
31
26
  cp ./src/config.js "$project_root/functions/config.js"
32
27
 
28
+ if [ ! -f "$project_root/functions/index.js" ]; then
29
+ cp ./src/.env.dev "$project_root/functions/index.js"
30
+ fi
31
+
33
32
  if [ ! -f "$project_root/functions/.env.dev" ]; then
34
33
  cp ./src/.env.dev "$project_root/functions/.env.dev"
35
34
  fi
@@ -51,13 +50,4 @@ if [ ! -f "$project_root/functions/package.json" ]; then
51
50
  cd "$project_root/functions"
52
51
  npm install --no-audit --silent
53
52
  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";
53
+ fi