lightshortcuts 1.0.2 → 1.0.3
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/bin/lsc.js +21 -8
- package/lsc.config.json +1 -1
- package/package.json +1 -1
package/bin/lsc.js
CHANGED
|
@@ -93,19 +93,31 @@ program.command("config").action(function () {
|
|
|
93
93
|
choices: [
|
|
94
94
|
{ key: 0, value: 0, name: "保留", checked: true },
|
|
95
95
|
{ key: 1, value: 1, name: "暂停" },
|
|
96
|
-
{ key: 2, value:
|
|
96
|
+
{ key: 2, value: 2, name: "结束" },
|
|
97
97
|
],
|
|
98
98
|
},
|
|
99
|
+
{
|
|
100
|
+
type: "input",
|
|
101
|
+
message: "发布日志:",
|
|
102
|
+
name: "release_desc",
|
|
103
|
+
default: "功能更新",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: "input",
|
|
107
|
+
message: "请输入API前缀地址:",
|
|
108
|
+
name: "lightBaseURL",
|
|
109
|
+
default: "https://xxx.xxx.xxx/lightadmin/pas-api",
|
|
110
|
+
when:(answers)=>{
|
|
111
|
+
initAnswers = Object.assign({},answers);
|
|
112
|
+
// console.log("initAnswers",initAnswers);
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
},
|
|
99
116
|
{
|
|
100
117
|
type: "confirm",
|
|
101
118
|
message: "是否使用以上配置?",
|
|
102
119
|
name: "useConfig",
|
|
103
120
|
default: true,
|
|
104
|
-
when: function (answers) {
|
|
105
|
-
initAnswers = answers;
|
|
106
|
-
console.log(answers);
|
|
107
|
-
return true;
|
|
108
|
-
},
|
|
109
121
|
},
|
|
110
122
|
{
|
|
111
123
|
type: "confirm",
|
|
@@ -118,18 +130,19 @@ program.command("config").action(function () {
|
|
|
118
130
|
},
|
|
119
131
|
])
|
|
120
132
|
.then((asw) => {
|
|
133
|
+
// console.log("initAnswersXXXXX",initAnswers);
|
|
121
134
|
// 用户输入的结果最终会在这里输出
|
|
122
135
|
let { useConfig, saveConfig } = asw;
|
|
123
136
|
if (useConfig) {
|
|
124
137
|
let totalConfig = {
|
|
125
138
|
publishInfo: {...initAnswers,apps_name:defaultConfig.publishInfo.apps_name},
|
|
126
|
-
lightBaseURL:
|
|
139
|
+
lightBaseURL:asw.lightBaseURL,
|
|
127
140
|
};
|
|
128
141
|
if (saveConfig) {
|
|
129
142
|
// 保存配置
|
|
130
143
|
writeConfig(totalConfig);
|
|
131
144
|
}
|
|
132
|
-
|
|
145
|
+
console.log(totalConfig);
|
|
133
146
|
} else {
|
|
134
147
|
console.log("已结束!");
|
|
135
148
|
}
|
package/lsc.config.json
CHANGED