This repository was archived by the owner on Sep 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 279
279
replaceBaseHref ( 'latest' ) ;
280
280
281
281
//-- update firebase.json file
282
- writeFirebaseJson ( ) ;
282
+ updateFirebaseJson ( ) ;
283
283
exec ( [ 'git commit --amend --no-edit -a' ] , options ) ;
284
284
done ( ) ;
285
285
292
292
'cd ..'
293
293
) ;
294
294
295
- function writeFirebaseJson ( ) {
295
+ function updateFirebaseJson ( ) {
296
296
fs . writeFileSync ( options . cwd + '/firebase.json' , getFirebaseJson ( ) ) ;
297
297
function getFirebaseJson ( ) {
298
- var json = require ( options . cwd + '/firebase.json' ) ;
299
- json . rewrites = json . rewrites || [ ] ;
300
- switch ( json . rewrites . length ) {
298
+ var json = require ( options . cwd + '/firebase.json' ) ;
299
+ json . hosting . rewrites = json . hosting . rewrites || [ ] ;
300
+ var rewrites = json . hosting . rewrites ;
301
+
302
+ switch ( rewrites . length ) {
301
303
case 0 :
302
- json . rewrites . push ( getRewrite ( 'HEAD' ) ) ;
304
+ rewrites . push ( getRewrite ( 'HEAD' ) ) ;
303
305
case 1 :
304
- json . rewrites . push ( getRewrite ( 'latest' ) ) ;
306
+ rewrites . push ( getRewrite ( 'latest' ) ) ;
305
307
default :
306
- json . rewrites . push ( getRewrite ( newVersion ) ) ;
308
+ rewrites . push ( getRewrite ( newVersion ) ) ;
307
309
}
308
310
return JSON . stringify ( json , null , 2 ) ;
309
311
function getRewrite ( str ) {
You can’t perform that action at this time.
0 commit comments