@leverege/build-tools 2.17.0 → 2.17.1

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.
@@ -37,6 +37,16 @@ if (!firebaserc || !firebaseJson) {
37
37
  const firebasercContent = JSON.parse(await _zx.fs.readFile(_zx.path.join(process.cwd(), '.firebaserc'), {
38
38
  encoding: 'utf-8'
39
39
  }));
40
+ const hasLocalConfig = await _zx.fs.exists(_zx.path.join(process.cwd(), SECRETS_DIR, 'local.env'));
41
+ const defaultTargets = {};
42
+
43
+ if (hasLocalConfig) {
44
+ defaultTargets.local = {
45
+ siteId: 'local',
46
+ alias: 'local'
47
+ };
48
+ }
49
+
40
50
  const targets = Object.entries(firebasercContent.targets).reduce((prev, [projectId, config]) => {
41
51
  Object.entries(config.hosting).forEach(([siteId, aliases]) => {
42
52
  aliases.forEach(alias => {
@@ -48,7 +58,7 @@ const targets = Object.entries(firebasercContent.targets).reduce((prev, [project
48
58
  });
49
59
  });
50
60
  return prev;
51
- }, {});
61
+ }, defaultTargets);
52
62
 
53
63
  if (!TARGET) {
54
64
  const {
Binary file
@@ -37,6 +37,16 @@ if (!firebaserc || !firebaseJson) {
37
37
  const firebasercContent = JSON.parse(await _zx.fs.readFile(_zx.path.join(process.cwd(), '.firebaserc'), {
38
38
  encoding: 'utf-8'
39
39
  }));
40
+ const hasLocalConfig = await _zx.fs.exists(_zx.path.join(process.cwd(), SECRETS_DIR, 'local.env'));
41
+ const defaultTargets = {};
42
+
43
+ if (hasLocalConfig) {
44
+ defaultTargets.local = {
45
+ siteId: 'local',
46
+ alias: 'local'
47
+ };
48
+ }
49
+
40
50
  const targets = Object.entries(firebasercContent.targets).reduce((prev, [projectId, config]) => {
41
51
  Object.entries(config.hosting).forEach(([siteId, aliases]) => {
42
52
  aliases.forEach(alias => {
@@ -48,7 +58,7 @@ const targets = Object.entries(firebasercContent.targets).reduce((prev, [project
48
58
  });
49
59
  });
50
60
  return prev;
51
- }, {});
61
+ }, defaultTargets);
52
62
 
53
63
  if (!TARGET) {
54
64
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.17.0",
3
+ "version": "2.17.1",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -37,6 +37,15 @@ if ( !firebaserc || !firebaseJson ) {
37
37
  }
38
38
 
39
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' ) )
41
+ const defaultTargets = {}
42
+
43
+ if ( hasLocalConfig ) {
44
+ defaultTargets.local = {
45
+ siteId : 'local',
46
+ alias : 'local'
47
+ }
48
+ }
40
49
 
41
50
  const targets = Object
42
51
  .entries( firebasercContent.targets )
@@ -54,7 +63,7 @@ const targets = Object
54
63
  } )
55
64
 
56
65
  return prev
57
- }, {} )
66
+ }, defaultTargets )
58
67
 
59
68
  if ( !TARGET ) {
60
69
  const { targetEnv } = await prompt( {