Commit 3a5b2bb
committed
fix(schematics): move firestore starter files after init, widen error handling
Tyler's review on #3714: createFirestoreStarterFiles staged the Tree
before the DataConnect init calls, using a pre-init firebase.json
snapshot. If a future init call ever added a firestore section
mid-run, the stale snapshot would miss it and stage starter files on
top of files firebase-tools already wrote to disk — the same
Tree/disk collision the .firebaserc write hit earlier in this PR.
Moved the call to run after init with a fresh re-read, and documented
the more immediate invariant this enforces: it must run before
addFirestoreToFirebaseJson, which is what adds the firestore section
on a normal run.
Also widened addFirestoreToFirebaseJson's try/catch to cover the
firebase.json mutation and write, not just the read — a write
failure (disk full, permissions) previously crashed with a raw Node
error instead of the warn-and-continue the read path already gets.1 parent 702a0cb commit 3a5b2bb
3 files changed
Lines changed: 41 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
168 | 176 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
104 | | - | |
105 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
106 | 116 | | |
107 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
108 | 122 | | |
109 | 123 | | |
110 | | - | |
111 | | - | |
| 124 | + | |
| 125 | + | |
112 | 126 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | 127 | | |
119 | 128 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
| |||
149 | 147 | | |
150 | 148 | | |
151 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
152 | 164 | | |
153 | 165 | | |
154 | 166 | | |
| |||
0 commit comments