@netmind/arena-cli 0.7.2 → 0.7.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/index.js CHANGED
@@ -177,8 +177,13 @@ function saveConfig(config) {
177
177
  const merged = { ...existing, ...config };
178
178
  writeFileSync(getConfigFile(), JSON.stringify(merged, null, 2) + "\n");
179
179
  }
180
+ function normalizeApiUrl(raw) {
181
+ const trimmed = raw.trim().replace(/\/+$/, "");
182
+ return /\/api$/.test(trimmed) ? trimmed : `${trimmed}/api`;
183
+ }
180
184
  function getApiUrl() {
181
- return process.env.ARENA_API_URL || loadConfig().api_url;
185
+ const raw = process.env.ARENA_API_URL || loadConfig().api_url;
186
+ return normalizeApiUrl(raw);
182
187
  }
183
188
  function requireCredentials(credentialsPath) {
184
189
  try {