forked from Rajan/lesspod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfbase_prep.js
More file actions
36 lines (21 loc) · 851 Bytes
/
fbase_prep.js
File metadata and controls
36 lines (21 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// The goal of this file is to replace all axios calls from vue client with firebase calls.
var shell = require('shelljs');
if (!shell.which('git')) {
shell.echo('Sorry, this script requires git');
shell.exit(1);
} else {
// shell.echo('Git found here');
}
shell.exec('git branch -D fbase');
shell.exec('git checkout -b fbase');
// inject connect to firebase in index.html
/// read from file
var initFbase = shell.cat('firebase_init.txt');
console.log('initFbase ===' + initFbase);
shell.sed('-i', '</body>', initFbase + '</body>', './client/vue/index.html');
shell.sed('-i', `deploymentTarget: 'localhost'`, `deploymentTarget: 'firebase'`, './client/vue/src/main.js');
// Run external tool synchronously
// if (shell.exec('git checkout -b fbase').code === 0) {
// shell.echo('fbase git branch created.');
// shell.exit(1);
// }