@pitcher/cli-scripts 2.0.2 → 2.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/dist/src/publishApp.js +4 -4
- package/package.json +1 -1
package/dist/src/publishApp.js
CHANGED
|
@@ -62,8 +62,8 @@ async function fetchAllInstances(baseUrl, apiKey) {
|
|
|
62
62
|
}
|
|
63
63
|
function filterInstancesByEnvName(instances, envName) {
|
|
64
64
|
const normalizedEnvName = envName.toLowerCase();
|
|
65
|
-
const filtered = instances.filter((instance) => instance.
|
|
66
|
-
instance.
|
|
65
|
+
const filtered = instances.filter((instance) => instance.environment &&
|
|
66
|
+
instance.environment.name.toLowerCase() === normalizedEnvName);
|
|
67
67
|
if (filtered.length === 0) {
|
|
68
68
|
console.warn(`No instances found with environment name "${envName}"`);
|
|
69
69
|
}
|
|
@@ -94,8 +94,8 @@ async function installAppToInstances(baseUrl, apiKey, appName, instances) {
|
|
|
94
94
|
}
|
|
95
95
|
const instanceIds = instances.map((inst) => inst.id);
|
|
96
96
|
console.log(`\nInstalling app "${appName}" to ${instances.length} instance(s):`);
|
|
97
|
-
instances.forEach((
|
|
98
|
-
console.log(` - ${
|
|
97
|
+
instances.forEach((i) => {
|
|
98
|
+
console.log(` - ${i.id}${i.environment?.name ? ` (${i.environment.name})` : ""}${i.name ? ` - ${i.name}` : ""}`);
|
|
99
99
|
});
|
|
100
100
|
try {
|
|
101
101
|
const response = await axios.post(`${baseUrl}/api/v1/apps/${appName}/install/`, { instance_ids: instanceIds }, {
|