sdd-skills 1.1.9 → 1.1.10
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.
- package/install.js +10 -12
- package/package.json +1 -1
- package/uninstall.js +6 -10
package/install.js
CHANGED
|
@@ -77,21 +77,21 @@ async function promptInstallation() {
|
|
|
77
77
|
message: 'Would you like to configure DingTalk notifications? (y/n)',
|
|
78
78
|
default: 'n',
|
|
79
79
|
validate: (input) => {
|
|
80
|
-
const normalized = input.toLowerCase().trim();
|
|
80
|
+
const normalized = String(input).toLowerCase().trim();
|
|
81
81
|
if (['y', 'n', 'yes', 'no', ''].includes(normalized)) {
|
|
82
82
|
return true;
|
|
83
83
|
}
|
|
84
84
|
return 'Please enter y or n';
|
|
85
85
|
},
|
|
86
|
-
filter: (input) => {
|
|
87
|
-
const normalized = input.toLowerCase().trim();
|
|
88
|
-
return normalized === 'y' || normalized === 'yes';
|
|
89
|
-
},
|
|
90
86
|
},
|
|
91
87
|
]);
|
|
92
88
|
|
|
89
|
+
// Convert to boolean
|
|
90
|
+
const wantsDingTalk = ['y', 'yes'].includes(String(answers.configureDingTalk).toLowerCase().trim());
|
|
91
|
+
answers.configureDingTalk = wantsDingTalk;
|
|
92
|
+
|
|
93
93
|
// Prompt for DingTalk webhook if user wants to configure
|
|
94
|
-
if (
|
|
94
|
+
if (wantsDingTalk) {
|
|
95
95
|
const dingTalkAnswers = await inquirer.prompt([
|
|
96
96
|
{
|
|
97
97
|
type: 'input',
|
|
@@ -259,20 +259,18 @@ async function install() {
|
|
|
259
259
|
message: 'Proceed with installation? (y/n)',
|
|
260
260
|
default: 'y',
|
|
261
261
|
validate: (input) => {
|
|
262
|
-
const normalized = input.toLowerCase().trim();
|
|
262
|
+
const normalized = String(input).toLowerCase().trim();
|
|
263
263
|
if (['y', 'n', 'yes', 'no', ''].includes(normalized)) {
|
|
264
264
|
return true;
|
|
265
265
|
}
|
|
266
266
|
return 'Please enter y or n';
|
|
267
267
|
},
|
|
268
|
-
filter: (input) => {
|
|
269
|
-
const normalized = input.toLowerCase().trim();
|
|
270
|
-
return normalized === '' || normalized === 'y' || normalized === 'yes';
|
|
271
|
-
},
|
|
272
268
|
},
|
|
273
269
|
]);
|
|
274
270
|
|
|
275
|
-
|
|
271
|
+
const shouldInstall = ['', 'y', 'yes'].includes(String(confirmInstall).toLowerCase().trim());
|
|
272
|
+
|
|
273
|
+
if (!shouldInstall) {
|
|
276
274
|
console.log(chalk.yellow('\n⚠️ Installation cancelled by user\n'));
|
|
277
275
|
process.exit(0);
|
|
278
276
|
}
|
package/package.json
CHANGED
package/uninstall.js
CHANGED
|
@@ -99,16 +99,12 @@ async function promptUninstallation() {
|
|
|
99
99
|
return existsSync(configPath);
|
|
100
100
|
},
|
|
101
101
|
validate: (input) => {
|
|
102
|
-
const normalized = input.toLowerCase().trim();
|
|
102
|
+
const normalized = String(input).toLowerCase().trim();
|
|
103
103
|
if (['y', 'n', 'yes', 'no', ''].includes(normalized)) {
|
|
104
104
|
return true;
|
|
105
105
|
}
|
|
106
106
|
return 'Please enter y or n';
|
|
107
107
|
},
|
|
108
|
-
filter: (input) => {
|
|
109
|
-
const normalized = input.toLowerCase().trim();
|
|
110
|
-
return normalized === '' || normalized === 'y' || normalized === 'yes';
|
|
111
|
-
},
|
|
112
108
|
},
|
|
113
109
|
{
|
|
114
110
|
type: 'input',
|
|
@@ -122,19 +118,19 @@ async function promptUninstallation() {
|
|
|
122
118
|
},
|
|
123
119
|
default: 'n',
|
|
124
120
|
validate: (input) => {
|
|
125
|
-
const normalized = input.toLowerCase().trim();
|
|
121
|
+
const normalized = String(input).toLowerCase().trim();
|
|
126
122
|
if (['y', 'n', 'yes', 'no', ''].includes(normalized)) {
|
|
127
123
|
return true;
|
|
128
124
|
}
|
|
129
125
|
return 'Please enter y or n';
|
|
130
126
|
},
|
|
131
|
-
filter: (input) => {
|
|
132
|
-
const normalized = input.toLowerCase().trim();
|
|
133
|
-
return normalized === 'y' || normalized === 'yes';
|
|
134
|
-
},
|
|
135
127
|
},
|
|
136
128
|
]);
|
|
137
129
|
|
|
130
|
+
// Convert to boolean
|
|
131
|
+
answers.removeConfig = ['', 'y', 'yes'].includes(String(answers.removeConfig || 'n').toLowerCase().trim());
|
|
132
|
+
answers.confirm = ['y', 'yes'].includes(String(answers.confirm).toLowerCase().trim());
|
|
133
|
+
|
|
138
134
|
return answers;
|
|
139
135
|
}
|
|
140
136
|
|