@leverege/build-tools 2.17.1 → 2.17.2

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.
Binary file
@@ -20,24 +20,28 @@ let TARGET = _zx.argv._[0];
20
20
  let exited = false;
21
21
  const SECRETS_DIR = 'secrets';
22
22
  const EXIT_EVENTS = ['SIGINT', 'exit', 'uncaughtException', 'unhandledRejection'];
23
- const [firebaserc, firebaseJson] = await Promise.all([_zx.fs.exists(_zx.path.join(process.cwd(), '.firebaserc')), _zx.fs.exists(_zx.path.join(process.cwd(), 'firebase.json'))]);
23
+ const [firebaserc, firebaseJson, hasLocalConfig] = await Promise.all([_zx.fs.exists(_zx.path.join(process.cwd(), '.firebaserc')), _zx.fs.exists(_zx.path.join(process.cwd(), 'firebase.json')), _zx.fs.exists(_zx.path.join(process.cwd(), SECRETS_DIR, 'local.env'))]);
24
24
 
25
- if (!firebaserc) {
26
- console.log(_zx.chalk.red('No .firebaserc file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
27
- }
25
+ if (!hasLocalConfig) {
26
+ if (!firebaserc) {
27
+ console.log(_zx.chalk.red('No .firebaserc file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
28
+ }
28
29
 
29
- if (!firebaseJson) {
30
- console.log(_zx.chalk.red('No firebase.json file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
31
- }
30
+ if (!firebaseJson) {
31
+ console.log(_zx.chalk.red('No firebase.json file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
32
+ }
32
33
 
33
- if (!firebaserc || !firebaseJson) {
34
- process.exit();
34
+ if (!firebaserc || !firebaseJson) {
35
+ process.exit();
36
+ }
35
37
  }
36
38
 
37
- const firebasercContent = JSON.parse(await _zx.fs.readFile(_zx.path.join(process.cwd(), '.firebaserc'), {
39
+ const firebasercContent = firebaserc ? JSON.parse(await _zx.fs.readFile(_zx.path.join(process.cwd(), '.firebaserc'), {
38
40
  encoding: 'utf-8'
39
- }));
40
- const hasLocalConfig = await _zx.fs.exists(_zx.path.join(process.cwd(), SECRETS_DIR, 'local.env'));
41
+ })) : {
42
+ targets: {}
43
+ };
44
+ console.log(firebaserc, firebasercContent);
41
45
  const defaultTargets = {};
42
46
 
43
47
  if (hasLocalConfig) {
Binary file
@@ -20,24 +20,28 @@ let TARGET = _zx.argv._[0];
20
20
  let exited = false;
21
21
  const SECRETS_DIR = 'secrets';
22
22
  const EXIT_EVENTS = ['SIGINT', 'exit', 'uncaughtException', 'unhandledRejection'];
23
- const [firebaserc, firebaseJson] = await Promise.all([_zx.fs.exists(_zx.path.join(process.cwd(), '.firebaserc')), _zx.fs.exists(_zx.path.join(process.cwd(), 'firebase.json'))]);
23
+ const [firebaserc, firebaseJson, hasLocalConfig] = await Promise.all([_zx.fs.exists(_zx.path.join(process.cwd(), '.firebaserc')), _zx.fs.exists(_zx.path.join(process.cwd(), 'firebase.json')), _zx.fs.exists(_zx.path.join(process.cwd(), SECRETS_DIR, 'local.env'))]);
24
24
 
25
- if (!firebaserc) {
26
- console.log(_zx.chalk.red('No .firebaserc file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
27
- }
25
+ if (!hasLocalConfig) {
26
+ if (!firebaserc) {
27
+ console.log(_zx.chalk.red('No .firebaserc file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
28
+ }
28
29
 
29
- if (!firebaseJson) {
30
- console.log(_zx.chalk.red('No firebase.json file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
31
- }
30
+ if (!firebaseJson) {
31
+ console.log(_zx.chalk.red('No firebase.json file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
32
+ }
32
33
 
33
- if (!firebaserc || !firebaseJson) {
34
- process.exit();
34
+ if (!firebaserc || !firebaseJson) {
35
+ process.exit();
36
+ }
35
37
  }
36
38
 
37
- const firebasercContent = JSON.parse(await _zx.fs.readFile(_zx.path.join(process.cwd(), '.firebaserc'), {
39
+ const firebasercContent = firebaserc ? JSON.parse(await _zx.fs.readFile(_zx.path.join(process.cwd(), '.firebaserc'), {
38
40
  encoding: 'utf-8'
39
- }));
40
- const hasLocalConfig = await _zx.fs.exists(_zx.path.join(process.cwd(), SECRETS_DIR, 'local.env'));
41
+ })) : {
42
+ targets: {}
43
+ };
44
+ console.log(firebaserc, firebasercContent);
41
45
  const defaultTargets = {};
42
46
 
43
47
  if (hasLocalConfig) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.17.1",
3
+ "version": "2.17.2",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -18,26 +18,33 @@ const EXIT_EVENTS = [ 'SIGINT', 'exit', 'uncaughtException', 'unhandledRejection
18
18
 
19
19
  const [
20
20
  firebaserc,
21
- firebaseJson
21
+ firebaseJson,
22
+ hasLocalConfig
22
23
  ] = await Promise.all( [
23
24
  fs.exists( path.join( process.cwd(), '.firebaserc' ) ),
24
- fs.exists( path.join( process.cwd(), 'firebase.json' ) )
25
+ fs.exists( path.join( process.cwd(), 'firebase.json' ) ),
26
+ fs.exists( path.join( process.cwd(), SECRETS_DIR, 'local.env' ) )
25
27
  ] )
26
28
 
27
- if ( !firebaserc ) {
28
- console.log( chalk.red( 'No .firebaserc file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.' ) )
29
- }
30
-
31
- if ( !firebaseJson ) {
32
- console.log( chalk.red( 'No firebase.json file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.' ) )
29
+ if ( !hasLocalConfig ) {
30
+ if ( !firebaserc ) {
31
+ console.log( chalk.red( 'No .firebaserc file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.' ) )
32
+ }
33
+
34
+ if ( !firebaseJson ) {
35
+ console.log( chalk.red( 'No firebase.json file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.' ) )
36
+ }
37
+
38
+ if ( !firebaserc || !firebaseJson ) {
39
+ process.exit()
40
+ }
33
41
  }
34
42
 
35
- if ( !firebaserc || !firebaseJson ) {
36
- process.exit()
37
- }
43
+ const firebasercContent = firebaserc ?
44
+ JSON.parse( await fs.readFile( path.join( process.cwd(), '.firebaserc' ), { encoding : 'utf-8' } ) ) :
45
+ { targets : {} }
38
46
 
39
- const firebasercContent = JSON.parse( await fs.readFile( path.join( process.cwd(), '.firebaserc' ), { encoding : 'utf-8' } ) )
40
- const hasLocalConfig = await fs.exists( path.join( process.cwd(), SECRETS_DIR, 'local.env' ) )
47
+ console.log( firebaserc, firebasercContent )
41
48
  const defaultTargets = {}
42
49
 
43
50
  if ( hasLocalConfig ) {