@mono-labs/cli 0.0.113 → 0.0.115
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.
|
@@ -54,6 +54,8 @@ export function buildCommands(files) {
|
|
|
54
54
|
Object.entries(files).forEach(([commandName, configObject]) => {
|
|
55
55
|
const optionsData = configObject.options || {};
|
|
56
56
|
|
|
57
|
+
console.log('configObject:', JSON.stringify(configObject, null, 2));
|
|
58
|
+
|
|
57
59
|
let current = program
|
|
58
60
|
.command(commandName)
|
|
59
61
|
.description(configObject.description || 'Haste command');
|
|
@@ -96,23 +98,25 @@ export function buildCommands(files) {
|
|
|
96
98
|
let envDefaults = {};
|
|
97
99
|
|
|
98
100
|
console.log(arg);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (
|
|
107
|
-
argInfo &&
|
|
108
|
-
argInfo.options &&
|
|
109
|
-
!argInfo.options.includes(arg ?? argInfo.default)
|
|
110
|
-
) {
|
|
111
|
-
throw new Error(
|
|
112
|
-
`Invalid argument value for ${commandName}, must be one of: ${argInfo.options.join(
|
|
113
|
-
', '
|
|
114
|
-
)}`
|
|
101
|
+
if (argInfo) {
|
|
102
|
+
console.log(argInfo);
|
|
103
|
+
console.log(argInfo.options);
|
|
104
|
+
console.log(arg ?? argInfo.default);
|
|
105
|
+
console.log(
|
|
106
|
+
'logic calc',
|
|
107
|
+
!argInfo.options.includes(arg ?? argInfo.default)
|
|
115
108
|
);
|
|
109
|
+
if (
|
|
110
|
+
argInfo &&
|
|
111
|
+
argInfo.options &&
|
|
112
|
+
!argInfo.options.includes(arg ?? argInfo.default)
|
|
113
|
+
) {
|
|
114
|
+
throw new Error(
|
|
115
|
+
`Invalid argument value for ${commandName}, must be one of: ${argInfo.options.join(
|
|
116
|
+
', '
|
|
117
|
+
)}`
|
|
118
|
+
);
|
|
119
|
+
}
|
|
116
120
|
}
|
|
117
121
|
|
|
118
122
|
const optionsDataList = Object.keys(optionsData).map((key) => ({
|