@mikarinneoracle/oci-cdk-code-only-preview 0.0.30 → 0.0.31
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/deploy-code-only.js +8 -1
- package/package.json +1 -1
package/bin/deploy-code-only.js
CHANGED
|
@@ -53,6 +53,13 @@ function runtimeResourceName(runtime) {
|
|
|
53
53
|
return runtime.name || runtime['runtime-name'] || runtime.runtimeName || runtime['runtimeName'] || '';
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
function listItems(result) {
|
|
57
|
+
if (Array.isArray(result?.data)) return result.data;
|
|
58
|
+
if (Array.isArray(result?.data?.items)) return result.data.items;
|
|
59
|
+
if (Array.isArray(result?.items)) return result.items;
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
|
|
56
63
|
function pythonRuntimeSortKey(runtimeName) {
|
|
57
64
|
const match = runtimeName.toLowerCase().match(/^python(\d+)/);
|
|
58
65
|
return match ? Number.parseInt(match[1], 10) : -1;
|
|
@@ -65,7 +72,7 @@ function resolvePythonRuntime(runtime) {
|
|
|
65
72
|
const normalizedRuntime = runtime.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
66
73
|
const namePrefix = normalizedRuntime === 'python' ? 'python' : normalizedRuntime;
|
|
67
74
|
const result = jsonOci(['fn', 'runtime', 'list', '--all', '--name-starts-with', namePrefix]);
|
|
68
|
-
const candidates = (result
|
|
75
|
+
const candidates = listItems(result)
|
|
69
76
|
.map(runtimeResourceName)
|
|
70
77
|
.filter((name) => name.toLowerCase().startsWith(namePrefix));
|
|
71
78
|
if (!candidates.length) {
|