repofence 0.1.4 → 0.1.5

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.
@@ -6,18 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.loadEnv = void 0;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
+ const os_1 = __importDefault(require("os"));
9
10
  const dotenv_1 = __importDefault(require("dotenv"));
10
- const candidates = ['.env.local', '.env'];
11
+ // Load only from ~/.repofence/.env — never from the user's project cwd.
12
+ // A globally installed CLI must not pick up arbitrary .env files from
13
+ // whatever directory the user happens to be standing in.
11
14
  const loadEnv = () => {
12
- for (const file of candidates) {
13
- const fullPath = path_1.default.join(process.cwd(), file);
14
- if (fs_1.default.existsSync(fullPath)) {
15
- dotenv_1.default.config({ path: fullPath });
16
- return;
17
- }
15
+ const globalEnv = path_1.default.join(os_1.default.homedir(), '.repofence', '.env');
16
+ if (fs_1.default.existsSync(globalEnv)) {
17
+ dotenv_1.default.config({ path: globalEnv });
18
18
  }
19
- // Fallback to default behavior (.env in cwd) if none exists
20
- dotenv_1.default.config();
21
19
  };
22
20
  exports.loadEnv = loadEnv;
23
21
  //# sourceMappingURL=env-loader.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repofence",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Repofence CLI (packs + backend auth)",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {