@pitcher/cli-scripts 2.0.1 → 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/README.md +1 -1
- package/dist/src/publishApp.js +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,4 +44,4 @@ p publish-app --increment-version --install-to-env-name "Production"
|
|
|
44
44
|
- `--dry-run`: Perform a dry run without publishing
|
|
45
45
|
- `--publish-url <url>`: Explicit publish URL
|
|
46
46
|
- `--install-to <instanceIds>`: Comma-separated list of instance IDs to install the app to after publishing
|
|
47
|
-
- `--install-to-env-name <envName>`: Environment name to filter instances and install the app to after publishing
|
|
47
|
+
- `--install-to-env-name <envName>`: Environment name to filter instances and install the app to after publishing (case-insensitive)
|
package/dist/src/publishApp.js
CHANGED
|
@@ -61,7 +61,9 @@ async function fetchAllInstances(baseUrl, apiKey) {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
function filterInstancesByEnvName(instances, envName) {
|
|
64
|
-
const
|
|
64
|
+
const normalizedEnvName = envName.toLowerCase();
|
|
65
|
+
const filtered = instances.filter((instance) => instance.environment &&
|
|
66
|
+
instance.environment.name.toLowerCase() === normalizedEnvName);
|
|
65
67
|
if (filtered.length === 0) {
|
|
66
68
|
console.warn(`No instances found with environment name "${envName}"`);
|
|
67
69
|
}
|
|
@@ -92,8 +94,8 @@ async function installAppToInstances(baseUrl, apiKey, appName, instances) {
|
|
|
92
94
|
}
|
|
93
95
|
const instanceIds = instances.map((inst) => inst.id);
|
|
94
96
|
console.log(`\nInstalling app "${appName}" to ${instances.length} instance(s):`);
|
|
95
|
-
instances.forEach((
|
|
96
|
-
console.log(` - ${
|
|
97
|
+
instances.forEach((i) => {
|
|
98
|
+
console.log(` - ${i.id}${i.environment?.name ? ` (${i.environment.name})` : ""}${i.name ? ` - ${i.name}` : ""}`);
|
|
97
99
|
});
|
|
98
100
|
try {
|
|
99
101
|
const response = await axios.post(`${baseUrl}/api/v1/apps/${appName}/install/`, { instance_ids: instanceIds }, {
|