-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-env.ts
More file actions
24 lines (21 loc) · 906 Bytes
/
test-env.ts
File metadata and controls
24 lines (21 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { createRequire } from 'module';
// Load environment variables
function loadEnvironment() {
if (typeof Bun === 'undefined') {
// For Node.js
try {
const require = createRequire(import.meta.url);
require('dotenv').config();
console.log("Loaded environment variables for Node.js");
} catch (error) {
console.warn('dotenv not available, relying on environment variables being set externally');
}
} else {
console.log("Running in Bun - environment variables should be loaded automatically");
}
}
loadEnvironment();
console.log("GITHUB_TOKEN:", process.env.GITHUB_TOKEN ? "exists" : "missing");
console.log("GITHUB_USERNAME:", process.env.GITHUB_USERNAME ? "exists" : "missing");
console.log("CODEBERG_TOKEN:", process.env.CODEBERG_TOKEN ? "exists" : "missing");
console.log("CODEBERG_USERNAME:", process.env.CODEBERG_USERNAME ? "exists" : "missing");