@cloudbase/cli 2.6.0-alpha.5 → 2.6.0-alpha.7
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 -11
- package/package.json +1 -1
package/lib/commands/fun/base.js
CHANGED
|
@@ -54,6 +54,7 @@ let FunListCommand = class FunListCommand extends common_1.Command {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
execute(envId, log) {
|
|
57
|
+
var _a;
|
|
57
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
59
|
const loading = (0, utils_1.loadingFactory)();
|
|
59
60
|
if (!envId) {
|
|
@@ -68,13 +69,10 @@ let FunListCommand = class FunListCommand extends common_1.Command {
|
|
|
68
69
|
.request('DescribeCloudBaseRunServers', {
|
|
69
70
|
EnvId: envId,
|
|
70
71
|
Limit: 100,
|
|
71
|
-
Offset: 0
|
|
72
|
-
Filter: {
|
|
73
|
-
Tag: 'function'
|
|
74
|
-
}
|
|
72
|
+
Offset: 0
|
|
75
73
|
})
|
|
76
74
|
.finally(() => loading.stop());
|
|
77
|
-
const serverList = serverListRes.CloudBaseRunServerSet;
|
|
75
|
+
const serverList = (_a = serverListRes.CloudBaseRunServerSet) === null || _a === void 0 ? void 0 : _a.filter((item) => item.Tag === 'function');
|
|
78
76
|
const head = ['服务名称', '状态', '创建时间', '更新时间'];
|
|
79
77
|
const tableData = serverList.map((serverItem) => [
|
|
80
78
|
serverItem.ServerName,
|
|
@@ -177,7 +175,7 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
177
175
|
Limit: 1,
|
|
178
176
|
Offset: 0
|
|
179
177
|
});
|
|
180
|
-
if (fetchSvrRes.ServerName && !
|
|
178
|
+
if (fetchSvrRes.ServerName && !_isFunRunService(fetchSvrRes.Tag)) {
|
|
181
179
|
log.error(`${serviceName} 服务已存在,但不是一个函数式托管服务,请使用另外的服务名称`);
|
|
182
180
|
return;
|
|
183
181
|
}
|
|
@@ -231,7 +229,7 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
231
229
|
envId,
|
|
232
230
|
serviceName,
|
|
233
231
|
filePath: source,
|
|
234
|
-
fileToIgnore: includeNodeModules ? [] : ['node_modules/**/*']
|
|
232
|
+
fileToIgnore: ['logs', 'logs/**/*'].concat(includeNodeModules ? [] : ['node_modules', 'node_modules/**/*'])
|
|
235
233
|
});
|
|
236
234
|
packageName = PackageName;
|
|
237
235
|
packageVersion = PackageVersion;
|
|
@@ -412,8 +410,10 @@ function _inputAppId(defaultVal = '') {
|
|
|
412
410
|
return answers['appId'];
|
|
413
411
|
});
|
|
414
412
|
}
|
|
415
|
-
function
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
413
|
+
function _isFunRunService(tagStr) {
|
|
414
|
+
if (!tagStr)
|
|
415
|
+
return false;
|
|
416
|
+
const tags = tagStr.split(',');
|
|
417
|
+
const tagList = tags.map((item) => item.split(':')[0]);
|
|
418
|
+
return tagList.includes('function');
|
|
419
419
|
}
|