repofence 0.1.3 → 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.
- package/dist/commands/auth.js +2 -2
- package/dist/core/env-loader.js +7 -9
- package/package.json +1 -1
package/dist/commands/auth.js
CHANGED
|
@@ -17,13 +17,13 @@ const promptToken = async () => {
|
|
|
17
17
|
};
|
|
18
18
|
const authCommand = async (_cwd, options) => {
|
|
19
19
|
if (options.web) {
|
|
20
|
-
const authBase = process.env.REPOFENCE_AUTH_URL || 'https://repofence.com/
|
|
20
|
+
const authBase = process.env.REPOFENCE_AUTH_URL || 'https://repofence.com/pricing';
|
|
21
21
|
const state = Math.random().toString(36).slice(2, 10);
|
|
22
22
|
const url = `${authBase}?state=${encodeURIComponent(state)}`;
|
|
23
23
|
console.log('\n' + chalk_1.default.bold('='.repeat(60)));
|
|
24
24
|
console.log(chalk_1.default.bold('repofence — Get your license'));
|
|
25
25
|
console.log(chalk_1.default.bold('='.repeat(60)));
|
|
26
|
-
console.log('\nOpening your browser to:\n ' + chalk_1.default.underline(
|
|
26
|
+
console.log('\nOpening your browser to:\n ' + chalk_1.default.underline(authBase) + '\n');
|
|
27
27
|
await (0, open_1.default)(url, { wait: false });
|
|
28
28
|
console.log(chalk_1.default.dim('─'.repeat(60)));
|
|
29
29
|
console.log(chalk_1.default.bold('Next steps:\n'));
|
package/dist/core/env-loader.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|