@leverege/build-tools 2.21.4 → 2.21.5

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.
@@ -64,17 +64,24 @@ const targets = Object.entries(firebasercContent.targets).reduce((prev, [project
64
64
  }, defaultTargets);
65
65
 
66
66
  if (!TARGET) {
67
- const {
68
- targetEnv
69
- } = await prompt({
70
- type: 'autocomplete',
71
- name: 'targetEnv',
72
- message: 'Which environment would you like to serve?',
73
- choices: Object.keys(targets).map(t => ({
74
- name: t,
75
- value: t
76
- }))
77
- });
67
+ const choices = Object.keys(targets).map(t => ({
68
+ name: t,
69
+ value: t
70
+ }));
71
+ let targetEnv;
72
+
73
+ if (choices.length > 1) {
74
+ const res = await prompt({
75
+ type: 'autocomplete',
76
+ name: 'targetEnv',
77
+ message: 'Which environment would you like to serve?',
78
+ choices
79
+ });
80
+ targetEnv = res.targetEnv;
81
+ } else {
82
+ targetEnv = choices[0].value;
83
+ }
84
+
78
85
  TARGET = targets[targetEnv];
79
86
  } else {
80
87
  TARGET = targets[TARGET];
@@ -64,17 +64,24 @@ const targets = Object.entries(firebasercContent.targets).reduce((prev, [project
64
64
  }, defaultTargets);
65
65
 
66
66
  if (!TARGET) {
67
- const {
68
- targetEnv
69
- } = await prompt({
70
- type: 'autocomplete',
71
- name: 'targetEnv',
72
- message: 'Which environment would you like to serve?',
73
- choices: Object.keys(targets).map(t => ({
74
- name: t,
75
- value: t
76
- }))
77
- });
67
+ const choices = Object.keys(targets).map(t => ({
68
+ name: t,
69
+ value: t
70
+ }));
71
+ let targetEnv;
72
+
73
+ if (choices.length > 1) {
74
+ const res = await prompt({
75
+ type: 'autocomplete',
76
+ name: 'targetEnv',
77
+ message: 'Which environment would you like to serve?',
78
+ choices
79
+ });
80
+ targetEnv = res.targetEnv;
81
+ } else {
82
+ targetEnv = choices[0].value;
83
+ }
84
+
78
85
  TARGET = targets[targetEnv];
79
86
  } else {
80
87
  TARGET = targets[TARGET];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.21.4",
3
+ "version": "2.21.5",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -72,12 +72,22 @@ const targets = Object
72
72
  }, defaultTargets )
73
73
 
74
74
  if ( !TARGET ) {
75
- const { targetEnv } = await prompt( {
76
- type : 'autocomplete',
77
- name : 'targetEnv',
78
- message : 'Which environment would you like to serve?',
79
- choices : Object.keys( targets ).map( t => ( { name : t, value : t } ) )
80
- } )
75
+ const choices = Object.keys( targets ).map( t => ( { name : t, value : t } ) )
76
+
77
+ let targetEnv
78
+
79
+ if ( choices.length > 1 ) {
80
+ const res = await prompt( {
81
+ type : 'autocomplete',
82
+ name : 'targetEnv',
83
+ message : 'Which environment would you like to serve?',
84
+ choices
85
+ } )
86
+
87
+ targetEnv = res.targetEnv
88
+ } else {
89
+ targetEnv = choices[0].value
90
+ }
81
91
 
82
92
  TARGET = targets[targetEnv]
83
93
  } else {
package/src/.swp DELETED
Binary file