@elevasis/sdk 1.5.0 → 1.5.1

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.
Files changed (2) hide show
  1. package/dist/cli.cjs +26 -5
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -43862,8 +43862,21 @@ function resolveApiKey(prod) {
43862
43862
  }
43863
43863
  return process.env.ELEVASIS_PLATFORM_KEY ?? "";
43864
43864
  }
43865
+ function preParseEnvFlag(argv = process.argv) {
43866
+ const idx = argv.indexOf("--env");
43867
+ if (idx === -1 || idx + 1 >= argv.length) return void 0;
43868
+ const envPath2 = (0, import_path.resolve)(argv[idx + 1]);
43869
+ argv.splice(idx, 2);
43870
+ return envPath2;
43871
+ }
43865
43872
  function findEnvFile(startDir) {
43866
- const cwd = (0, import_path.resolve)(startDir ?? process.cwd());
43873
+ const raw = (0, import_path.resolve)(startDir ?? process.cwd());
43874
+ let cwd;
43875
+ try {
43876
+ cwd = (0, import_fs.realpathSync)(raw);
43877
+ } catch {
43878
+ cwd = raw;
43879
+ }
43867
43880
  let dir = cwd;
43868
43881
  while (true) {
43869
43882
  const candidate = (0, import_path.resolve)(dir, ".env");
@@ -43984,7 +43997,7 @@ function wrapAction(commandName, fn) {
43984
43997
  // package.json
43985
43998
  var package_default = {
43986
43999
  name: "@elevasis/sdk",
43987
- version: "1.5.0",
44000
+ version: "1.5.1",
43988
44001
  description: "SDK for building Elevasis organization resources",
43989
44002
  type: "module",
43990
44003
  bin: {
@@ -45843,13 +45856,18 @@ function registerProjectCommands(program3) {
45843
45856
  }
45844
45857
 
45845
45858
  // src/cli/index.ts
45846
- var envPath = findEnvFile();
45859
+ var explicitEnvPath = preParseEnvFlag();
45860
+ var envPath = explicitEnvPath ?? findEnvFile();
45847
45861
  if (envPath) {
45848
- (0, import_dotenv.config)({ path: envPath, override: true });
45862
+ const result = (0, import_dotenv.config)({ path: envPath, override: true });
45863
+ if (result.error) {
45864
+ console.error(source_default.yellow(`\u26A0 Found .env at ${envPath} but failed to load it: ${result.error.message}`));
45865
+ }
45849
45866
  } else if (!process.env.ELEVASIS_PLATFORM_KEY) {
45850
45867
  const cwd = process.cwd();
45851
45868
  console.error(source_default.yellow(`\u26A0 No .env file found (searched upward from ${cwd})`));
45852
- console.error(source_default.gray(" Set ELEVASIS_PLATFORM_KEY in a .env at your project root."));
45869
+ console.error(source_default.gray(" Set ELEVASIS_PLATFORM_KEY in a .env at your project root,"));
45870
+ console.error(source_default.gray(" or use --env <path> to specify the file location."));
45853
45871
  }
45854
45872
  var program2 = new Command();
45855
45873
  program2.name("elevasis-sdk").description(
@@ -45866,6 +45884,9 @@ Commands:
45866
45884
  elevasis-sdk deployments List deployments
45867
45885
  elevasis-sdk rename <id> --to <newId> [--prod] Rename resource across platform tables
45868
45886
 
45887
+ Global options:
45888
+ --env <path> Path to .env file (overrides automatic discovery)
45889
+
45869
45890
  Use "elevasis-sdk <command> --help" for more information about a command.`
45870
45891
  ).version(SDK_VERSION);
45871
45892
  registerCheckCommand(program2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/sdk",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "SDK for building Elevasis organization resources",
5
5
  "type": "module",
6
6
  "bin": {