episoda 0.2.48 → 0.2.49

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
@@ -2559,17 +2559,27 @@ var require_auth = __commonJS({
2559
2559
  }
2560
2560
  async function loadConfig9(configPath) {
2561
2561
  const fullPath = getConfigPath4(configPath);
2562
- if (!fs14.existsSync(fullPath)) {
2563
- return null;
2562
+ if (fs14.existsSync(fullPath)) {
2563
+ try {
2564
+ const content = fs14.readFileSync(fullPath, "utf8");
2565
+ const config = JSON.parse(content);
2566
+ return config;
2567
+ } catch (error) {
2568
+ console.error("Error loading config:", error);
2569
+ }
2564
2570
  }
2565
- try {
2566
- const content = fs14.readFileSync(fullPath, "utf8");
2567
- const config = JSON.parse(content);
2568
- return config;
2569
- } catch (error) {
2570
- console.error("Error loading config:", error);
2571
- return null;
2571
+ if (process.env.EPISODA_ACCESS_TOKEN) {
2572
+ return {
2573
+ access_token: process.env.EPISODA_ACCESS_TOKEN,
2574
+ api_url: process.env.EPISODA_API_URL || "https://episoda.dev",
2575
+ project_id: process.env.EPISODA_PROJECT_ID || "",
2576
+ user_id: process.env.EPISODA_USER_ID || "",
2577
+ workspace_id: process.env.EPISODA_WORKSPACE_ID || "",
2578
+ workspace_slug: process.env.EPISODA_WORKSPACE,
2579
+ project_slug: process.env.EPISODA_PROJECT
2580
+ };
2572
2581
  }
2582
+ return null;
2573
2583
  }
2574
2584
  async function saveConfig3(config, configPath) {
2575
2585
  const fullPath = getConfigPath4(configPath);