@cloudbase/cli 2.6.0-alpha.0 → 2.6.0-alpha.2
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/lib/commands/fun/base.js +11 -5
- package/package.json +1 -1
package/lib/commands/fun/base.js
CHANGED
|
@@ -60,12 +60,15 @@ let FunListCommand = class FunListCommand extends common_1.Command {
|
|
|
60
60
|
if (!envId) {
|
|
61
61
|
envId = yield _selectEnv();
|
|
62
62
|
}
|
|
63
|
+
else {
|
|
64
|
+
log.info(`当前环境 Id:${envId}`);
|
|
65
|
+
}
|
|
63
66
|
try {
|
|
64
67
|
loading.start('获取函数式托管服务列表中…');
|
|
65
68
|
let serverListRes = yield scfService
|
|
66
69
|
.request('DescribeCloudBaseRunServers', {
|
|
67
70
|
EnvId: envId,
|
|
68
|
-
Limit:
|
|
71
|
+
Limit: 100,
|
|
69
72
|
Offset: 0
|
|
70
73
|
})
|
|
71
74
|
.finally(() => loading.stop());
|
|
@@ -117,7 +120,7 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
117
120
|
},
|
|
118
121
|
{
|
|
119
122
|
flags: '--source <source>',
|
|
120
|
-
desc: '
|
|
123
|
+
desc: '目标函数文件所在目录路径。默认为当前路径'
|
|
121
124
|
},
|
|
122
125
|
{
|
|
123
126
|
flags: '--target <target>',
|
|
@@ -136,7 +139,7 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
136
139
|
const loadResult = yield (0, functions_framework_1.loadUserFunction)(source, target);
|
|
137
140
|
if (!(loadResult === null || loadResult === void 0 ? void 0 : loadResult.userFunction)) {
|
|
138
141
|
if (loadResult.reason.includes('is not a loadable module')) {
|
|
139
|
-
log.error(`${source}
|
|
142
|
+
log.error(`${source} 不是一个有效的函数式托管代码目录,可以通过 --source <source> 指定代码目录路径`);
|
|
140
143
|
}
|
|
141
144
|
else if (loadResult === null || loadResult === void 0 ? void 0 : loadResult.reason.includes('is not defined in the provided module')) {
|
|
142
145
|
log.error(`主文件并未导出目标函数 ${target},请导出 ${target} 目标函数或者通过 --target <target> 指定目标函数`);
|
|
@@ -149,6 +152,9 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
149
152
|
if (!envId) {
|
|
150
153
|
envId = yield _selectEnv();
|
|
151
154
|
}
|
|
155
|
+
else {
|
|
156
|
+
log.info(`当前环境 Id:${envId}`);
|
|
157
|
+
}
|
|
152
158
|
if (!serviceName) {
|
|
153
159
|
let pkgName = '';
|
|
154
160
|
try {
|
|
@@ -165,7 +171,7 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
165
171
|
const fetchSvrRes = yield scfService.request('DescribeCloudBaseRunServer', {
|
|
166
172
|
EnvId: envId,
|
|
167
173
|
ServerName: serviceName,
|
|
168
|
-
Limit:
|
|
174
|
+
Limit: 1,
|
|
169
175
|
Offset: 0
|
|
170
176
|
});
|
|
171
177
|
if (fetchSvrRes.ServerName && fetchSvrRes.Tag !== 'function') {
|
|
@@ -284,7 +290,7 @@ let FunRunCommand = class FunRunCommand extends common_1.Command {
|
|
|
284
290
|
options: [
|
|
285
291
|
{
|
|
286
292
|
flags: '--source <source>',
|
|
287
|
-
desc: '
|
|
293
|
+
desc: '目标函数文件所在目录路径,默认为当前路径'
|
|
288
294
|
},
|
|
289
295
|
{
|
|
290
296
|
flags: '--port <port>',
|